Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

displaying a word document on clicking a menu item

Posted on 2003-11-30
1
Medium Priority
?
191 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

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

INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
The viewer will learn how to implement Singleton Design Pattern in Java.
Suggested Courses

721 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