From bf63a8bc9c848f77187506453031e8cc0b19ef25 Mon Sep 17 00:00:00 2001 From: Scott Stamp Date: Sat, 13 Oct 2018 19:48:39 -0230 Subject: [PATCH] Removed usage of File.separator() Don't use this for fetching files inside the JAR, it can cause issues on Windows --- G-Earth-UI/src/main/java/gearth/ui/buttons/BoxButton.java | 4 ++-- .../main/java/gearth/ui/buttons/PauseResumeButton.java | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/G-Earth-UI/src/main/java/gearth/ui/buttons/BoxButton.java b/G-Earth-UI/src/main/java/gearth/ui/buttons/BoxButton.java index 17025c9..0afd90c 100644 --- a/G-Earth-UI/src/main/java/gearth/ui/buttons/BoxButton.java +++ b/G-Earth-UI/src/main/java/gearth/ui/buttons/BoxButton.java @@ -18,8 +18,8 @@ public class BoxButton extends StackPane { //paths zijn relatief aan deze classpath public BoxButton(String imageName, String imageOnHoverName) { - this.image = new Image(getClass().getResourceAsStream("files" + File.separator + imageName)); - this.imageOnHover = new Image(getClass().getResourceAsStream("files" + File.separator + imageOnHoverName)); + this.image = new Image(getClass().getResourceAsStream("files/" + imageName)); + this.imageOnHover = new Image(getClass().getResourceAsStream("files/" + imageOnHoverName)); this.imageView = new ImageView(); setCursor(Cursor.DEFAULT); diff --git a/G-Earth-UI/src/main/java/gearth/ui/buttons/PauseResumeButton.java b/G-Earth-UI/src/main/java/gearth/ui/buttons/PauseResumeButton.java index 2e4b2cf..9f50777 100644 --- a/G-Earth-UI/src/main/java/gearth/ui/buttons/PauseResumeButton.java +++ b/G-Earth-UI/src/main/java/gearth/ui/buttons/PauseResumeButton.java @@ -32,10 +32,10 @@ public class PauseResumeButton extends StackPane{ public PauseResumeButton(boolean isPaused) { this.isPaused[0] = isPaused; - this.imagePause = new Image(getClass().getResourceAsStream("files"+ File.separator+"ButtonPause.png")); - this.imagePauseOnHover = new Image(getClass().getResourceAsStream("files"+ File.separator+"ButtonPauseHover.png")); - this.imageResume = new Image(getClass().getResourceAsStream("files"+ File.separator+"ButtonResume.png")); - this.imageResumeOnHover = new Image(getClass().getResourceAsStream("files"+ File.separator+"ButtonResumeHover.png")); + this.imagePause = new Image(getClass().getResourceAsStream("files/ButtonPause.png")); + this.imagePauseOnHover = new Image(getClass().getResourceAsStream("files/ButtonPauseHover.png")); + this.imageResume = new Image(getClass().getResourceAsStream("files/ButtonResume.png")); + this.imageResumeOnHover = new Image(getClass().getResourceAsStream("files/ButtonResumeHover.png")); this.imageView = new ImageView(); setCursor(Cursor.DEFAULT);