/**
* Ask for a new building name using TextInputDialog in JavaFX/8
* @return new name
*/
public String askNameFX(String oldName) {
String newName = null;
TextInputDialog dialog = new TextInputDialog(oldName);
dialog.setTitle(Msg.getString("BuildingPanel.renameBuilding.dialogTitle"));
dialog.setHeaderText(Msg.getString("BuildingPanel.renameBuilding.dialog.header"));
dialog.setContentText(Msg.getString("BuildingPanel.renameBuilding.dialog.content"));
Optional<String> result = dialog.showAndWait();
//result.ifPresent(name -> {});
if (result.isPresent()){
logger.info("The old building name has been changed to: " + result.get());
newName = result.get();
}
return newName;
}
BuildingPanel.java 文件源码
java
阅读 34
收藏 0
点赞 0
评论 0
项目:mars-sim
作者:
评论列表
文章目录