aspose file tools
The moose likes Swing / AWT / SWT and the fly likes a small GUI question Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Reply Bookmark "a small GUI question" Watch "a small GUI question" New topic
Author

a small GUI question

Paul Liullllllllllll
Greenhorn

Joined: Jul 07, 2004
Posts: 3
Hi,

I have a button, and when I click it, I want to open a file (txt or html) in the local filesystem. In the ActionPerformed method, I don't know use which class to open this file and show the contents, can anyone give me a hint? thanks in advance.
Gregg Bolinger
Ranch Hand

Joined: Jul 11, 2001
Posts: 15230

JFileChooser
Paul Liullllllllllll
Greenhorn

Joined: Jul 07, 2004
Posts: 3
thanks. I know I can use JFileChooser to select a file, but how to display the contents of this file, I mean use notepad or IE to open a file.
Aaron Roberts
Ranch Hand

Joined: Sep 10, 2002
Posts: 174
You could use a JTextArea for the text. Are you going to simply display the file or are they going to edit it?

Regards,
Aaron R>
Paul Liullllllllllll
Greenhorn

Joined: Jul 07, 2004
Posts: 3
thanks, just for display, I'll try what you suggested. But I am still wondering if there is any way to call native application to open a file.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: a small GUI question
 
Similar Threads
Open Dialog JFileChooser
Opening Word
use of Runtime.getRuntime().exec
Ant error: Make sure you have it in you classpath
pdc viewer software needed