Forums Register Login

FileDialog

+Pie Number of slices to send: Send
hi
i want that when user clicks on the close button of the JInternal frame,
and if there are changes that are to be saved
a Save File dialog box should be poped up
till this point everything is working fine
but if instead of clicking on the save button
user clicks on the cancel button then the Internal frame is also getting disposed
whereas only the File dialog should get disposed
please respond to the problem soon
bye
ritu
the
+Pie Number of slices to send: Send
Hai,
Hope this code will be helpful to u.

if (mFile.mBool_modified) {
int nRtn = JOptionPane.showConfirmDialog(this,"Not saved project! would you save the project?"
,"Yes to save",JOptionPane.YES_NO_CANCEL_OPTION);
if (nRtn == JOptionPane.YES_OPTION) {
int nSave =mFile.save(false, null);
if (nSave == HwDocument._SAVE_NOERROR) {
System.out.println("promt saved");
setInfo("[" + mFile.mStr_fileFullPath + " - " + mFile.mStr_projectName + "] saved");
} else {
setInfo("[" + mFile.mStr_fileFullPath + " - " + mFile.mStr_projectName + "] failed to save");
JOptionPane.showMessageDialog(this
,"cannot save the project[" + mFile.mStr_fileFullPath + " - " + mFile.mStr_projectName
+ "]...\nplease, try later"
,"Project save error",JOptionPane.WARNING_MESSAGE);
return false;
}
}
else if (nRtn == JOptionPane.CANCEL_OPTION)
{
System.out.println("From CANCEL_OPTION");
}
}
Cheers
Rajesh

Originally posted by ritu mahendru:
hi
i want that when user clicks on the close button of the JInternal frame,
and if there are changes that are to be saved
a Save File dialog box should be poped up
till this point everything is working fine
but if instead of clicking on the save button
user clicks on the cancel button then the Internal frame is also getting disposed
whereas only the File dialog should get disposed
please respond to the problem soon
bye
ritu
the


You ridiculous clown, did you think you could get away with it? This is my favorite tiny ad!
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 1382 times.
Similar Threads
downloading generated report in JSF
query
create Directory using JFileChooser
FileDialog.SAVE (urgent please)??
disposing SAVE file dialog its urgent
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 02:33:41.