盾怪网教程:是一个免费提供流行杀毒软件教程、在线学习分享的学习平台!

JBuilder 9 开发一个文本编辑器

时间:2024/10/8作者:未知来源:盾怪网教程人气:

[摘要]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 开发一个文本编辑器




Copyright © 2012-2018 盾怪网教程(http://www.dunguai.com) .All Rights Reserved 网站地图 友情链接

免责声明:本站资源均来自互联网收集 如有侵犯到您利益的地方请及时联系管理删除,敬请见谅!

QQ:1006262270   邮箱:kfyvi376850063@126.com   手机版