List of usage examples for javafx.scene.control ButtonType APPLY
ButtonType APPLY
To view the source code for javafx.scene.control ButtonType APPLY.
Click Source Link
From source file:dev.archiecortez.jfacelog.dialogs.NewPassDialog.java
public NewPassDialog() throws IOException { super();/* w w w . j av a2 s . c om*/ FXMLLoader loader = new FXMLLoader(getClass().getResource("newpassdialog.fxml")); loader.setController(this); Parent root = loader.load(); this.getDialogPane().setContent(root); getDialogPane().getButtonTypes().add(ButtonType.APPLY); getDialogPane().getButtonTypes().add(ButtonType.CANCEL); getDialogPane().lookupButton(ButtonType.APPLY).disableProperty() .bind(newPassword.textProperty().isNotEqualTo(newPasswordCopy.textProperty()) .or(newPassword.textProperty().isEmpty()).or(oldPassword.textProperty().isEmpty())); setResultConverter(value -> { if (value == ButtonType.APPLY) { return new Pair<>(oldPassword.getText(), newPassword.getText()); } else { return null; } }); }