I am working on an application where I have a frame with a menu bar. In a menu called File I have an open command that opens a file dialog box. This is how I coded it, I made a global object of the class and made it static so that I could pass that as the parent frame to the file dialog constructor. It just seems like it might not be the proper way to do it, any suggestions?
Hi Tom, I think FileDialog should be made modal. If that is the case then you should use fd.show() instead of fd.setVisible( true ). This will block on the statement until the user has chosen a file or cancelled the dialog. Then you can just get the chosen file and call some local method in the calling class. Regards, Manfred.
It's fun to be me, and still legal in 9 states! Wanna see my tiny ad?
Free, earth friendly heat - from the CodeRanch trailboss