[摘要]Save As 菜单调用。将下列代码紧放在saveFile()方法之后: // Save current file, asking user for new destination name. ...
Save As 菜单调用。将下列代码紧放在saveFile()方法之后:
// Save current file, asking user for new destination name.
// Report to statuBar.
boolean saveAsFile() {
// Use the SAVE version of the dialog, test return for Approve/Cancel
if (JFileChooser.APPROVE_OPTION == jFileChooser1.showSaveDialog(this)) {
// Set the current file name to the user's selection,
// then do a regular saveFile
currFileName = jFileChooser1.getSelectedFile().getPath();
//repaints menu after item is selected
this.repaint();
return saveFile();
}
else {
this.repaint();
return false;
}
}
菜单File
关键词:JBuilder 9 开发一个文本编辑器