| 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.
|
 |
 |
|
|
subject: a small GUI question
|
|
|