[FIX] JavaFX swing library for java 9+

This commit is contained in:
Gravit 2020-04-04 13:25:27 +07:00
parent a2ec922d20
commit 6c873f71c9
No known key found for this signature in database
GPG key ID: 061981E1E85D3216

View file

@ -71,10 +71,13 @@ public static void main(String[] arguments) throws IOException, InterruptedExcep
tryAddModule(findPath, "javafx.graphics", builder);
tryAddModule(findPath, "javafx.fxml", builder);
tryAddModule(findPath, "javafx.controls", builder);
boolean useSwing = tryAddModule(findPath, "javafx.swing", builder);
String modulePath = builder.toString();
if (!modulePath.isEmpty()) {
args.add("--add-modules");
args.add("javafx.base,javafx.fxml,javafx.controls,jdk.unsupported");
String javaModules = "javafx.base,javafx.fxml,javafx.controls,jdk.unsupported";
if(useSwing) javaModules = javaModules.concat(",javafx.swing");
args.add(javaModules);
args.add("--module-path");
args.add(modulePath);
}