diff --git a/src/main/java/es/kauron/jstudy/controller/Controller.java b/src/main/java/es/kauron/jstudy/controller/Controller.java index c4293f0..d48c325 100644 --- a/src/main/java/es/kauron/jstudy/controller/Controller.java +++ b/src/main/java/es/kauron/jstudy/controller/Controller.java @@ -55,8 +55,14 @@ public class Controller implements Initializable { @FXML private void onNewAction(ActionEvent event) { - TextInputDialog dialog = new TextInputDialog("Name"); + TextInputDialog dialog = new TextInputDialog(); + dialog.getEditor().setPromptText("Table name"); + dialog.setTitle("Creating new table"); + dialog.setHeaderText("Please input a name for the new table"); + dialog.getDialogPane().setMinWidth(250); dialog.showAndWait(); + dialog.setResultConverter(value -> value.getButtonData().equals(ButtonBar.ButtonData.OK_DONE) ? value.getText() : ""); + if (dialog.getResult() == null || dialog.getResult().isEmpty()) return; tabPane.getTabs().add(createTableTab(dialog.getResult(), new ArrayList<>())); tabPane.getSelectionModel().selectLast(); }