Solved

displaying a word document on clicking a menu item

Posted on 2003-11-30
1
188 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 125 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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Weekend adv creator 3 54
Windows 10 IE Certificate Issue 10 51
runtime exception 2 42
Tagging and Merging on Branch 1 30
For customizing the look of your lightweight component and making it look opaque like it was made of plastic.  This tip assumes your component to be of rectangular shape and completely opaque.   (CODE)
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …

820 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