import javafx.fxml.FXML; import javafx.fxml.FXMLLoader; import javafx.scene.Node; import javafx.scene.Parent; import javafx.stage.Stage; import javafx.scene.Scene; import ro.pub.cs.aipi.lab09.general.Constants; public class Authentication { private Stage applicationStage; private Scene applicationScene; // ... public void start() { try { applicationScene = new Scene((Parent)FXMLLoader.load(getClass().getResource(Constants.AUTHENTICATION_FXML))); } catch (Exception exception) { System.out.println ("An exception has occured: "+exception.getMessage()); if (Constants.DEBUG) exception.printStackTrace(); } applicationStage = new Stage(); applicationStage.setTitle(Constants.APPLICATION_NAME); applicationStage.getIcons().add(new Image(getClass().getResource(Constants.ICON_FILE_NAME).toExternalForm())); applicationStage.setScene(applicationScene); applicationStage.show(); } // ... }