Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

FileDialog save as FREEZE ?!?!  RSS feed

 
Peter Primrose
Ranch Hand
Posts: 755
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Guys,

I have a JDialog on the screen and the user can Save the info in it.

the thing is that the FileDialog recieves a JFrame and as a result,
when the user switch to a diff application (say IE) and retun to the application - he can't see the FileDialog, or in other workds, the application freeze.


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


I tried
Component c = SwingUtilities.getRoot((Component)e.getSource());
JFrame subframe = (JFrame)c;

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

but it doesn't work.


anyidea - I need a JDialog but the FileDialog recieves only frames ?!!?!?
 
Pat Hays
Ranch Hand
Posts: 138
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Peter,

using JFileChooser instead. It works.
------------------------------
JFileChooser fileChooser = new JFileChooser();
fileChooser.setDialogTitle("Save As");
int i = fileChooser.showSaveDialog(frame);
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!