Browse Source

Fixed dialog window size bug.

master
Chris Cromer 5 years ago
parent
commit
5edf2cd476
  1. 1
      src/cl/cromer/estructuras/Main.java
  2. 5
      src/cl/cromer/estructuras/MenuController.java

1
src/cl/cromer/estructuras/Main.java

@ -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();
}

5
src/cl/cromer/estructuras/MenuController.java

@ -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();
}

Loading…
Cancel
Save