my dog learned polymorphism
The moose likes Swing / AWT / SWT and the fly likes disposing SAVE file dialog its urgent Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "disposing SAVE file dialog its urgent " Watch "disposing SAVE file dialog its urgent " New topic

disposing SAVE file dialog its urgent

ritu mahendru

Joined: Nov 22, 2001
Posts: 3
problem in disposing the SAVE FileDialog
i am popping up the SAVE file dialog if user opts for YES_OPTION of the Dialog box given below
int rt=JOptionPane.showConfirmDialog(this,"Do you want to save changes in the file","Warning ",JOptionPane.YES_NO_OPTION);
if (rt==JOptionPane.YES_OPTION)
if (rt==JOptionPane.NO_OPTION)
the file dialog method contains the followin code
void fileDialog()
FileDialog file = new FileDialog (this,"Save File As Text File",FileDialog.SAVE);
the problem is when user clicks on the cancel button of this SAVE file dialog box the dialog box along with the internal frame is dispose
whereas we want that when user clicks on the cancel button only the save dialog box should go
not the internal frame as it usually happens in most of the softwares.
please consider it seriously because it is creating lot of other problem
reply soon
Manfred Leonhardt
Ranch Hand

Joined: Jan 09, 2001
Posts: 1492
Hi Ritu,
I think you should not be mixing AWT (FileDialog) with Swing (JOptionPane). You should use JFileChooser and your issues might just go bye-bye.
I agree. Here's the link:
subject: disposing SAVE file dialog its urgent
jQuery in Action, 3rd edition