• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

disposing SAVE file dialog its urgent

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi
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)
{
fileDialog();
}
if (rt==JOptionPane.NO_OPTION)
{
frames[f-1].setVisible(false);
}
the file dialog method contains the followin code
void fileDialog()
{
FileDialog file = new FileDialog (this,"Save File As Text File",FileDialog.SAVE);
file.setFile("*.txt");
file.setDirectory(".");
file.show();
}
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
 
Ranch Hand
Posts: 1492
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
Regards,
Manfred.
 
No. No. No. No. Changed my mind. Wanna come down. To see this tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic