2023年10月8日16:20:10

master
zhangmeng 2023-10-08 16:20:16 +08:00
parent 3853e1dd43
commit 7a6ab44ee3
1 changed files with 13 additions and 1 deletions

View File

@ -173,10 +173,22 @@ public class MonacoWebView extends AnchorPane {
if (event.isControlDown() && event.getCode() == KeyCode.S) {//保存
event.consume();
if (file != null){
try {
FileWriter writer = new FileWriter(file);
writer.write(text_code.getValue());
writer.flush();
writer.close();
} catch (IOException ex) {
ex.printStackTrace();
}
}else {
//
}
AlertUtils.alert_warning("保存成功!");
}
if (event.isControlDown() && event.getCode() == KeyCode.CONTROL) {//注释
if (event.isControlDown() && event.getCode() == KeyCode.DIVIDE) {//注释
event.consume();
window.call("commentLine");
}