File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Swing / AWT / SWT and the fly likes FileDialog Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "FileDialog" Watch "FileDialog" New topic
Author

FileDialog

ritu mahendru
Greenhorn

Joined: Nov 22, 2001
Posts: 3
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
Rajesh Kumar
Greenhorn

Joined: Nov 16, 2001
Posts: 28
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

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: FileDialog