- Joined
- Nov 5, 2014
- Messages
- 505
- Thread Author
- #1
My JavaFX GUI loads and functions correctly on my local version, but when live on the bot store it fails to display.
Here's my project structure:
I have added the fxml as a resource in my mainfest:
Here's the contents of my Main class (the one which extends application):
Which is then called in the onStart of my scripts main class like this:
However I think the problem is related to the following line as after some debugging it seems to be failing to find the resource, but this only happens on the bot store, it runs fine locally:
I've tried changing the base class and relocating the fxml file as necessary but it didn't solve the problem, both of these approaches work fine locally:
Any ideas? I really want to get my new UI out.
Here's my project structure:

I have added the fxml as a resource in my mainfest:
Code:
<resources>
<resource>scripts/MassFighter/GUI/FighterV1.fxml</resource>
</resources>
Here's the contents of my Main class (the one which extends application):
Code:
@Override
public void start(Stage primaryStage) throws Exception {
FXMLLoader loader = new FXMLLoader(getClass().getResource("FighterV1.fxml"));
Parent root = loader.load();
primaryStage.setTitle("MassFighter V4");
primaryStage.setScene(new Scene(root));
controller = loader.getController();
controller.initialize();
primaryStage.show();
}
Which is then called in the onStart of my scripts main class like this:
Code:
private void showAndWaitGUI() {
ui = new Main();
Platform.runLater(() -> {
try {
ui.start(new Stage());
} catch (Exception e) {
e.printStackTrace();
}
});
while (setupRunning) {
Execution.delay(100);
}
Platform.runLater(ui::close);
}
However I think the problem is related to the following line as after some debugging it seems to be failing to find the resource, but this only happens on the bot store, it runs fine locally:
Code:
FXMLLoader loader = new
FXMLLoader(getClass().getResource("FighterV1.fxml"));
I've tried changing the base class and relocating the fxml file as necessary but it didn't solve the problem, both of these approaches work fine locally:
Code:
FXMLLoader(MassFighter.getClass.getResource("FighterV1.fxml"))
Any ideas? I really want to get my new UI out.