🐛 修复 BUG 重复重命名文件失败

This commit is contained in:
gewuyou 2023-08-30 22:27:22 +08:00
parent 3a8b939cbe
commit c78a251084

View File

@ -45,6 +45,8 @@ public class RenameFile implements EventHandler<ActionEvent> {
File newFile = fileChooser.showSaveDialog(UiUtil.getAppWindow());
if (newFile != null) {
boolean rename = file.renameTo(newFile);
// 设置文件数据
jnotepadtab.setUserData(newFile);
if (rename) {
jnotepadtab.setText(newFile.getName());
logger.info("文件重命名成功");