I can use
ChoiceDialog<String> dialog = new ChoiceDialog();
dialog.showAndWait();
but i'll have only one choiceBox to use, and I need 3 of this in one dialog. How can i do this?
Here is the answer:
public void showAndWait(Window owner) throws IOException {
Dialog<String> dialog = new Dialog<>();
dialog.getDialogPane().setContent(FXMLLoader.load(getClass().getResource("/resources/customDialog.fxml")));
dialog.getDialogPane().setHeaderText("text");
ButtonType confirm = new ButtonType("ok", ButtonBar.ButtonData.OK_DONE);
ButtonType cancel = new ButtonType("cansel", ButtonBar.ButtonData.CANCEL_CLOSE);
dialog.getDialogPane().getButtonTypes().addAll(cancel, confirm);
dialog.initStyle(StageStyle.UNDECORATED);
dialog.setTitle("title");
dialog.initOwner(owner);
dialog.showAndWait();
}
Looks nice, i make class with this method, and use it class like controller to fxml, so now I can easily use any controls without any troubles
You can build yourself a custom dialog, using the tutorial at http://code.makery.ch/blog/javafx-dialogs-official/
I adapted their custom dialog for three dropdowns; in my case to merge two custom POJO camera objects with make, model and serial number. Feel free to adapt and use my code below.