This week's book giveaway is in the Cloud/Virtualizaton forum.
We're giving away four copies of Mesos in Action and have Roger Ignazio on-line!
See this thread for details.
Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

FileDialog save as FREEZE ?!?!

 
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