Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Metodo que crea la ventana principal y asigna el nombre
- **/
- @Override
- public void start(Stage primaryStage) throws IOException {
- this.primaryStage = primaryStage;
- this.primaryStage.setTitle("WeebReader App");
- showMainView();
- vista = "Login";
- showMainVistas(vista);
- }
- /**
- * Metodo que carga la Scena principal a la ventana y la muestra activa
- **/
- private void showMainView() throws IOException {
- FXMLLoader loader = new FXMLLoader();
- loader.setLocation(UI.class.getResource("/org/weebreader/UI/Vistas/VistaPrincipal.fxml"));
- mainLayout = loader.load();
- Scene scene = new Scene (mainLayout);
- primaryStage.setScene(scene);
- primaryStage.show();
- }
- /**
- * Metodo generico para cargar .FXML
- * @param recibe un String el cual es el nombre del archivo .fxml
- **/
- public static void showMainVistas(String extencion) throws IOException {
- FXMLLoader loader = new FXMLLoader();
- loader.setLocation(UI.class.getResource("/org/weebreader/UI/Vistas/"+ extencion +".fxml"));
- AnchorPane mainItems = loader.load();
- mainLayout.setCenter(mainItems);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement