This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Swing / AWT / SWT and the fly likes What if the FileDialog is invoked from a JDialog??? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "What if the FileDialog is invoked from a JDialog???" Watch "What if the FileDialog is invoked from a JDialog???" New topic
Author

What if the FileDialog is invoked from a JDialog???

Peter Primrose
Ranch Hand

Joined: Sep 10, 2004
Posts: 755
What if the FileDialog is invoked from a JDialog???

If I do this:
FileDialog fd = new FileDialog(new JFrame(),"Save As",FileDialog.SAVE);

this is ok BUT if the user switches to a diff aplication (say IE) the FileDialog is going backwords and the application is 'frozen'.

and i cant palce a JDialog in the constructor?

FileDialog fd = new FileDialog(???,"Save As",FileDialog.SAVE);


I tried to get the root frame with

Component c = SwingUtilities.getRoot((Component)e.getSource());
JFrame frame = (JFrame)c;


but it doesn't work because the 'rootFrame' is a dialog.

HELP

 
It is sorta covered in the JavaRanch Style Guide.
 
subject: What if the FileDialog is invoked from a JDialog???