Browse Source

test loading fxml with system specific file separator

terminal
Craig Raw 2 years ago
parent
commit
28722d385b
  1. 5
      src/main/java/com/sparrowwallet/sparrow/wallet/WalletController.java

5
src/main/java/com/sparrowwallet/sparrow/wallet/WalletController.java

@ -25,12 +25,12 @@ import javafx.scene.layout.BorderPane;
import javafx.scene.layout.StackPane; import javafx.scene.layout.StackPane;
import javafx.scene.layout.VBox; import javafx.scene.layout.VBox;
import org.controlsfx.control.textfield.CustomPasswordField; import org.controlsfx.control.textfield.CustomPasswordField;
import org.controlsfx.control.textfield.TextFields;
import org.controlsfx.glyphfont.FontAwesome; import org.controlsfx.glyphfont.FontAwesome;
import org.controlsfx.glyphfont.Glyph; import org.controlsfx.glyphfont.Glyph;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.net.URL; import java.net.URL;
import java.util.ResourceBundle; import java.util.ResourceBundle;
@ -91,6 +91,9 @@ public class WalletController extends WalletFormController implements Initializa
try { try {
if(!existing) { if(!existing) {
URL url = AppServices.class.getResource("wallet/" + function.toString().toLowerCase() + ".fxml"); URL url = AppServices.class.getResource("wallet/" + function.toString().toLowerCase() + ".fxml");
if(url == null) {
url = AppServices.class.getResource("wallet" + File.separator + function.toString().toLowerCase() + ".fxml");
}
if(url == null) { if(url == null) {
throw new IllegalStateException("Cannot find wallet/" + function.toString().toLowerCase() + ".fxml"); throw new IllegalStateException("Cannot find wallet/" + function.toString().toLowerCase() + ".fxml");
} }

Loading…
Cancel
Save