Fixed file paths so they work when it becomes an executable

- Changed file paths for the FXML files
main
Fan-Wu Yang 9 years ago
parent ee72d85f6a
commit c105c2d01e

@ -39,7 +39,7 @@ public class App extends Application {
//load the first container //load the first container
try { try {
FXMLLoader loader = new FXMLLoader(); FXMLLoader loader = new FXMLLoader();
InputStream in = getClass().getClassLoader().getResourceAsStream("scenes//mainpane.fxml"); InputStream in = getClass().getClassLoader().getResourceAsStream("scenes/mainpane.fxml");
mainContainer = (BorderPane) loader.load(in); mainContainer = (BorderPane) loader.load(in);
mainScene = new Scene(mainContainer, 1200, 800); mainScene = new Scene(mainContainer, 1200, 800);
primaryStage.setScene(mainScene); primaryStage.setScene(mainScene);
@ -63,7 +63,7 @@ public class App extends Application {
*/ */
public void loadPane(String fxmlName) throws Exception { public void loadPane(String fxmlName) throws Exception {
FXMLLoader loader = new FXMLLoader(); FXMLLoader loader = new FXMLLoader();
InputStream in = getClass().getClassLoader().getResourceAsStream("scenes//" + fxmlName); InputStream in = getClass().getClassLoader().getResourceAsStream("scenes/" + fxmlName);
Parent page; Parent page;
try { try {
page = (Parent) loader.load(in); page = (Parent) loader.load(in);

Loading…
Cancel
Save