I'm having issues with FXML loading with my project members who are running mac os. I'm fairly new to the whole JavaFX loading process within java code but this is how my code is set out at the moment. The class is called ControlPanel.java, the fxml is controlPanel.fxml, it contains onAction# methods and I'm using the ControlPanel.java as the controller for these methods. It works completely fine on windows operating systems but when we try to run it in eclipse it opens but doesn't display anything. Just wondering if i'm doing anything wrong. I defined the controller within the document at the top level which is an anchorPane fx:controller="project.fx.ControlPanel"
public static void main(String[] args) {
Application.launch(ControlPanel.class, (java.lang.String[])null);
}
@Override
public void start(Stage primaryStage) {
try {
Parent page = (Parent) FXMLLoader.load(getClass().getResource("controlPanel.fxml"), null, new JavaFXBuilderFactory());
Scene scene = new Scene(page);
primaryStage.initStyle(StageStyle.TRANSPARENT);
primaryStage.setScene(scene);
primaryStage.show();
} catch (Exception ex) {
Logger.getLogger(ControlPanel.class.getName()).log(Level.SEVERE, null, ex);
}
}
@FXML
protected void doSomething() {
System.out.println("Done something");
}