/**
* Shows a simple dialog that waits for the user to enter some text.
* @param message The message is shown in the content text of the dialog.
* @return The user input
*/
private String showTextInput(String message) {
TextInputDialog dialog = new TextInputDialog();
((Stage)dialog.getDialogPane().getScene().getWindow()).getIcons().add(new Image("file:pictures/icon.png"));
dialog.setTitle("Please input a value");
dialog.setHeaderText(null);
dialog.setContentText(message);
Optional<String> input = dialog.showAndWait();
if (input.isPresent()) {
if (!input.get().isEmpty()) {
return input.get();
} else {
new TDDTDialog("alert", "Missing input");
}
}
return "-1";
}
TDDTDialog.java 文件源码
java
阅读 41
收藏 0
点赞 0
评论 0
项目:programmierpraktikum-abschlussprojekt-nimmdochirgendeinennamen
作者:
评论列表
文章目录