- Joined
- Feb 9, 2019
- Messages
- 44
- Thread Author
- #1
I am trying to create a popup window to do configuration within my bot for a task-based system.
At this stage my main embedded javafx window is working 100%. Though I believe I am having pathing issues among other things when it comes to my secondary window. I have it that on button click, a window should popup, do a configuration, then pass the information back to the main class.
My code looks like:
and I get the error:
which is specifically on fxmlLoader.load() line. This is the same directory that contains my main_ui.fxml. I also have both using the same pathing systems, both exist in my bin dir and both in my manifest.xml as resources. I think it comes down to my lack of understanding of how these ui's are created.
Any help would be awesome!
At this stage my main embedded javafx window is working 100%. Though I believe I am having pathing issues among other things when it comes to my secondary window. I have it that on button click, a window should popup, do a configuration, then pass the information back to the main class.
My code looks like:
Code:
public static void runLater(Runnable runnable) {
if (Platform.isFxApplicationThread()) {
runnable.run();
}
else {
Platform.runLater(runnable);
}
}
////////////////////////////////////
// later on
configButton.setOnAction((event) -> {
runLater(() -> {
FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("com/lb25/gremlin/ui/config.fxml"));
try {
fxmlLoader.load();
} catch (IOException e1) {
e1.printStackTrace();
}
});
});
Code:
java.lang.IllegalStateException: Location is not set.
at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2434)
Any help would be awesome!