Hi,
I'm using FileDialog from AWT. How do I know when the open button is hit? Is there a listener that I should use?
Thanks,
Akee
Printable View
Hi,
I'm using FileDialog from AWT. How do I know when the open button is hit? Is there a listener that I should use?
Thanks,
Akee
The Open() or Show() ( Can't remember which ) will return once the open button has been hit.Quote:
Originally posted by akee
Hi,
I'm using FileDialog from AWT. How do I know when the open button is hit? Is there a listener that I should use?
Thanks,
Akee
Hi,
What I was trying to do was to take the filepath and put it in a text box on a different form than the FileDialog window when the user hits load in the FileDialog window. I don't know how to get the text or set up event listening for the load button. I'm kinda new at doing GUI's in Java.
Thanks,
Akee
Greetings.
Take a look at the API Specification and you'll find an answer.
First, call the show() method of the dialog. That blocks your app until the user has chosen a file and dismissed the dialog. Then, to get the chosen file, call one of those getDirectory() or getFile() methods. You can tell if the user has Cancelled the dialog by their returned values. If he has cancelled it, those methods return null, otherwise they return a String object.
Hope that helped,
Captain Nuss