Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

displaying a word document on clicking a menu item

Posted on 2003-11-30
1
Medium Priority
?
193 Views
Last Modified: 2010-03-31
I have 2 documents in word format. In my project (done using swing), i have a menu item named HELP, it has a drop down menu with 2 items. Clicking on each item should display the respective word document.

My question is how can you display a word document (or any text document) upon clicking a drop down menu item.  

Kindly reply.
0
Comment
Question by:kiranms
1 Comment
 
LVL 4

Accepted Solution

by:
Howie_Ly earned 500 total points
ID: 9847972
Attach an event to your Help drop down... then use this

String strURL = new String("c:\\mydoc.doc");
Runtime.getRuntime().exec("rundll32 url.dll,FileProtocolHandler "+strURL);

* assumes you have word installed.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
Suggested Courses

926 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question