Fixed dialog window size bug.

This commit is contained in:
Chris Cromer 2016-07-02 15:39:54 -04:00
parent 14cee919d9
commit 5edf2cd476
2 changed files with 4 additions and 2 deletions

View File

@ -54,6 +54,7 @@ public class Main extends Application {
dialog.setTitle(resourceBundle.getString("error"));
dialog.setContentText(mensaje);
dialog.getDialogPane().getButtonTypes().add(botonCerrar);
dialog.getDialogPane().getScene().getWindow().sizeToScene();
Main.setIcon(dialog, Main.class);
dialog.show();
}

View File

@ -237,7 +237,7 @@ public class MenuController extends VBox implements Initializable {
dialog.setContentText(resourceBundle.getString("cambiarIdiomaMensaje"));
dialog.getDialogPane().getButtonTypes().add(botonCancelar);
dialog.getDialogPane().getButtonTypes().add(botonCambiar);
dialog.getDialogPane().setPrefSize(400, 120);
dialog.getDialogPane().getScene().getWindow().sizeToScene();
Main.setIcon(dialog, getClass());
Optional<ButtonType> result = dialog.showAndWait();
@ -266,7 +266,7 @@ public class MenuController extends VBox implements Initializable {
dialog.setContentText(resourceBundle.getString("cambiarIdiomaMensaje"));
dialog.getDialogPane().getButtonTypes().add(botonCancelar);
dialog.getDialogPane().getButtonTypes().add(botonCambiar);
dialog.getDialogPane().setPrefSize(400, 120);
dialog.getDialogPane().getScene().getWindow().sizeToScene();
Main.setIcon(dialog, getClass());
Optional<ButtonType> result = dialog.showAndWait();
@ -293,6 +293,7 @@ public class MenuController extends VBox implements Initializable {
dialog.setTitle(resourceBundle.getString("acerca"));
dialog.setContentText(resourceBundle.getString("credito"));
dialog.getDialogPane().getButtonTypes().add(botonCerrar);
dialog.getDialogPane().getScene().getWindow().sizeToScene();
Main.setIcon(dialog, getClass());
dialog.show();
}