Add pom.xml and set up jar packaging

FXML loading needed to change when resources were packaged in jar.
This commit is contained in:
2025-03-09 15:15:08 -07:00
parent 81b347eb41
commit 48790790b4
4 changed files with 203 additions and 5 deletions

View File

@ -62,7 +62,7 @@ public class Main extends Application {
try {
if (startParams.notification().isPresent()){
FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("NotificationView.fxml"));
FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("/NotificationView.fxml"));
Parent root = fxmlLoader.load();
NotificationController controller = fxmlLoader.getController();
@ -72,7 +72,7 @@ public class Main extends Application {
primaryStage.setScene(new Scene(root));
primaryStage.show();
} else {
FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("MainView.fxml"));
FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("/MainView.fxml"));
Parent root = fxmlLoader.load();
MainController controller = fxmlLoader.getController();

View File

@ -66,7 +66,7 @@ public class MainController implements Initializable {
private void handleStationSettingsButtonPress() {
if (settingsStage == null || !settingsStage.isShowing()) {
try {
FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("StationSettingsView.fxml"));
FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("/StationSettingsView.fxml"));
Parent root = fxmlLoader.load();
StationSettingsController controller = fxmlLoader.getController();
@ -101,7 +101,7 @@ public class MainController implements Initializable {
private void handleSelectStationButtonPress() throws Exception {
if (selectStationStage == null || !selectStationStage.isShowing()) {
try {
FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("StationSelectionView.fxml"));
FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("/StationSelectionView.fxml"));
Parent root = fxmlLoader.load();
StationSelectionController controller = fxmlLoader.getController();

View File

@ -357,7 +357,7 @@ public class StationSettingsController {
@FXML
private void handleAddPrefixButtonPress() {
try {
FXMLLoader loader = new FXMLLoader(getClass().getResource("AddPrefixView.fxml"));
FXMLLoader loader = new FXMLLoader(getClass().getResource("/AddPrefixView.fxml"));
Parent root = loader.load();
AddPrefixController controller = loader.getController();