Skip to content

Commit d6a438a

Browse files
authored
Merge pull request #27 from petebankhead/fix-classloader
Fix classloader problem
2 parents b3b4076 + 85c3e4c commit d6a438a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/main/java/qupath/ext/wsinfer/ui/WSInferCommand.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
import javafx.stage.Stage;
2424
import org.slf4j.Logger;
2525
import org.slf4j.LoggerFactory;
26+
import qupath.lib.gui.ExtensionClassLoader;
2627
import qupath.lib.gui.QuPathGUI;
2728
import qupath.lib.gui.dialogs.Dialogs;
2829

@@ -69,7 +70,10 @@ private Stage createStage() throws IOException {
6970
throw new IOException("Cannot find URL for WSInfer FXML");
7071
}
7172

72-
VBox root = FXMLLoader.load(url, resources);
73+
// We need to use the ExtensionClassLoader to load the FXML, since it's in a different module
74+
var loader = new FXMLLoader(url, resources);
75+
loader.setClassLoader(QuPathGUI.getExtensionClassLoader());
76+
VBox root = loader.load();
7377

7478
// There's probably a better approach... but wrapping in a border pane
7579
// helped me get the resizing to behave

0 commit comments

Comments
 (0)