Skip to content

Commit

Permalink
Fix package names of FXML resources and open code
Browse files Browse the repository at this point in the history
Fix two errors in package names:

1. java.lang.IllegalStateException: Location is not set.

The application loads the FXML resources relative to its own package
org.openjfx.hellofx, but the resources are not found because they are in
a different package, org.openjfx. The fix is either to get the resources
using their absolute names, such as "/org/openjfx/primary.fxml", or to
change their package name to org.openjfx.hellofx. This fix changes the
package name.

2. java.lang.module.InvalidModuleDescriptorException:
     Package org.openjfx not found in module

The FXML classes use reflection to load the controllers in
org.openjfx.hellofx, but only the package org.openjfx, which contains no
code, is open to it. Fix the module descriptor to open the correct
package name of org.openjfx.hellofx.

Fixes openjfx#39
  • Loading branch information
jgneff committed Oct 20, 2019
1 parent 0bcbcd1 commit 3dcdd65
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
requires javafx.controls;
requires javafx.fxml;

opens org.openjfx to javafx.fxml;
opens org.openjfx.hellofx to javafx.fxml;
exports org.openjfx.hellofx;
}
}

0 comments on commit 3dcdd65

Please sign in to comment.