Commit 078b3967 authored by Axel Howind's avatar Axel Howind

change FxApplication consturctor to take String

parent 93f9dcb5
Pipeline #106844900 passed with stages
in 9 minutes and 54 seconds
......@@ -2,6 +2,10 @@
## Changes
#### Version 0.6.1
- change the FxApplication constructor argument to URL because of access problems in jlinked applications
#### Version 0.6.0
- use gradle 6
......
......@@ -34,7 +34,7 @@ subprojects {
/////////////////////////////////////////////////////////////////////////////
group = 'com.dua3.fx'
version = '0.6.0'
version = '0.6.1'
ext.moduleName = project.group
ext.scm = 'https://gitlab.com/com.dua3/lib/fx.git'
......
......@@ -93,7 +93,7 @@ public abstract class FxApplication<A extends FxApplication<A, C>, C extends FxC
/**
* Path to FXML file.
*/
private final String fxmlFile;
private final URL fxmlFile;
/**
* The controller instance.
......@@ -117,7 +117,7 @@ public abstract class FxApplication<A extends FxApplication<A, C>, C extends FxC
* @param fxmlFile the path to the FXML file to load, relative to the
* application class
*/
protected FxApplication(String fxmlFile) {
protected FxApplication(URL fxmlFile) {
this.fxmlFile = Objects.requireNonNull(fxmlFile);
}
......@@ -158,11 +158,8 @@ public abstract class FxApplication<A extends FxApplication<A, C>, C extends FxC
getParameterValue("log").ifPresent(this::setLogLevel);
// create a loader and load FXML
LOG.log(Level.FINE, () -> "loading FXML ...");
URL fxmlUrl = LangUtil.getResourceURL(getClass(), fxmlFile);
LOG.log(Level.FINER, () -> "FXML URL: " + fxmlUrl);
FXMLLoader loader = new FXMLLoader(fxmlUrl);
LOG.log(Level.FINER, () -> "FXML URL: " + fxmlFile);
FXMLLoader loader = new FXMLLoader(fxmlFile);
Parent root = loader.load();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment