Skip to content

Commit 3356136

Browse files
Fixed a thing that was broken for some reason
Signed-off-by: JayFromProgramming <ajsweene@mtu.edu>
1 parent 635793a commit 3356136

11 files changed

+19
-12
lines changed

src/main/java/com/example/clippyfx/HelloApplication.java

+14-7
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
import java.io.File;
1414
import java.io.IOException;
15+
import java.net.URL;
1516
import java.nio.file.Files;
1617
import java.nio.file.Path;
1718

@@ -29,13 +30,19 @@ public void start(Stage stage) throws IOException, InterruptedException {
2930
System.out.println("FFmpeg is not installed");
3031
System.exit(-27);
3132
}
32-
if (runUpdateCheck()){
33-
System.out.println("New version found");
34-
} else {
35-
System.out.println("No new version found");
36-
}
33+
// if (runUpdateCheck()){
34+
// System.out.println("New version found");
35+
// } else {
36+
// System.out.println("No new version found");
37+
// }
3738
new Thread(VideoChecks::checkEncoders).start();
38-
FXMLLoader fxmlLoader = new FXMLLoader(HelloApplication.class.getResource("hello-view.fxml"));
39+
// URL to the FXML file
40+
URL view = HelloApplication.class.getResource("/hello-view.fxml");
41+
if (view == null) {
42+
System.out.println("View object is null");
43+
System.exit(-1);
44+
}
45+
FXMLLoader fxmlLoader = new FXMLLoader(view);
3946
Scene scene = new Scene(fxmlLoader.load(), 949, 686);
4047
stage.setTitle("ClippyFX");
4148
stage.setScene(scene);
@@ -55,7 +62,7 @@ private boolean runUpdateCheck() throws IOException, InterruptedException {
5562
AutoUpdateView updateView = new AutoUpdateView(
5663
"https://api.github.com/repos/JayFromProgramming/ClippyFX");
5764
if (updateView.new_version_available()) {
58-
FXMLLoader fxmlLoader = new FXMLLoader(HelloApplication.class.getResource("update-view.fxml"));
65+
FXMLLoader fxmlLoader = new FXMLLoader(HelloApplication.class.getResource("/update-view.fxml"));
5966
Scene scene = new Scene(fxmlLoader.load(), 949, 686);
6067
Stage stage = new Stage();
6168
stage.setTitle("ClippyFX Update");

src/main/java/com/example/clippyfx/MainController.java

+5-5
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ public void clipIt() throws IOException, InterruptedException {
359359
}
360360
}
361361
}
362-
FXMLLoader fxmlLoader = new FXMLLoader(HelloApplication.class.getResource("clipping-view.fxml"));
362+
FXMLLoader fxmlLoader = new FXMLLoader(HelloApplication.class.getResource("/clipping-view.fxml"));
363363
Scene scene = new Scene(fxmlLoader.load(), 600, 400);
364364
Stage stage = new Stage();
365365
stage.setTitle("ClippyFX Clipping");
@@ -378,7 +378,7 @@ public void clipIt() throws IOException, InterruptedException {
378378
}
379379

380380
public void loadURLFile(String link) throws IOException, URISyntaxException, InterruptedException {
381-
FXMLLoader fxmlLoader = new FXMLLoader(HelloApplication.class.getResource("compatablityator-view.fxml"));
381+
FXMLLoader fxmlLoader = new FXMLLoader(HelloApplication.class.getResource("/compatablityator-view.fxml"));
382382
Scene scene = new Scene(fxmlLoader.load(), 600, 400);
383383
Stage stage = new Stage();
384384
stage.setTitle("ClippyFX: Advanced video loader");
@@ -391,7 +391,7 @@ public void loadURLFile(String link) throws IOException, URISyntaxException, Int
391391
}
392392

393393
public void loadFileDirect(File file) throws IOException, InterruptedException, URISyntaxException {
394-
FXMLLoader fxmlLoader = new FXMLLoader(HelloApplication.class.getResource("compatablityator-view.fxml"));
394+
FXMLLoader fxmlLoader = new FXMLLoader(HelloApplication.class.getResource("/compatablityator-view.fxml"));
395395
Scene scene = new Scene(fxmlLoader.load(), 600, 400);
396396
Stage stage = new Stage();
397397
stage.setTitle("ClippyFX: Advanced video loader");
@@ -413,7 +413,7 @@ public void loadFile(MouseEvent mouseEvent) throws IOException, InterruptedExcep
413413
}
414414
}
415415
}
416-
FXMLLoader fxmlLoader = new FXMLLoader(HelloApplication.class.getResource("compatablityator-view.fxml"));
416+
FXMLLoader fxmlLoader = new FXMLLoader(HelloApplication.class.getResource("/compatablityator-view.fxml"));
417417
Scene scene = new Scene(fxmlLoader.load(), 600, 400);
418418
Stage stage = new Stage();
419419
stage.setTitle("ClippyFX: Advanced video loader");
@@ -439,7 +439,7 @@ public void loadYoutube(String direct) throws IOException {
439439
}
440440
}
441441
}
442-
FXMLLoader fxmlLoader = new FXMLLoader(HelloApplication.class.getResource("youtube-view.fxml"));
442+
FXMLLoader fxmlLoader = new FXMLLoader(HelloApplication.class.getResource("/youtube-view.fxml"));
443443
Scene scene = new Scene(fxmlLoader.load(), 600, 213);
444444
Stage stage = new Stage();
445445
stage.setTitle("ClippyFX: Youtube video loader");

0 commit comments

Comments
 (0)