I am new at Java or JavaFX, but I am making a JavaFX desktop application. In Intellij, I created the project under JavaFX category. I am using JDK-15.
https://i.stack.imgur.com/jFZK7.png
Then, with FXML, using scenebuilder as editor for the FXML file, I am making the project. I am already using jfoenix library with JavaFX. Now, I want to implement feature like CARDPANE that is in gluon library in my project. I tried to add gluon charms glisten - 4.4.1 from dependencies.
https://i.stack.imgur.com/MWzpR.png
I guess what's left is to add something in VM options in configuration of RUN, I really don't know what to add in VM options. When I try to run the project there is an error, I cannot find any solution to this.
My FXML Code:
<?xml version="1.0" encoding="UTF-8"?>
<?import com.gluonhq.charm.glisten.control.CardPane?>
<?import javafx.scene.control.Button?>
<?import javafx.scene.layout.AnchorPane?>
<AnchorPane prefHeight="400.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/11.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="Practice.Practice_Controller">
<children>
<CardPane fx:id="cardPane" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.topAnchor="0.0">
<items>
<Button fx:id="addButton" mnemonicParsing="false" onAction="#handle" prefHeight="32.0" prefWidth="239.0" text="Button" />
</items>
</CardPane>
</children>
</AnchorPane>
The error that is shown:
"C:Program FilesJavajdk-15.0.1injava.exe" --module-path "C:Program FilesJavajavafx-sdk-15.0.1lib" --add-modules=javafx.base --add-modules=javafx.controls --add-modules=javafx.fxml --add-modules=javafx.graphics --add-modules=javafx.media --add-modules=javafx.swing --add-modules=javafx.web --add-opens javafx.base/com.sun.javafx.runtime=ALL-UNNAMED --add-opens javafx.controls/com.sun.javafx.scene.control.behavior=ALL-UNNAMED --add-opens javafx.controls/com.sun.javafx.scene.control=ALL-UNNAMED --add-opens javafx.base/com.sun.javafx.binding=ALL-UNNAMED --add-opens javafx.base/com.sun.javafx.event=ALL-UNNAMED --add-opens javafx.graphics/com.sun.javafx.stage=ALL-UNNAMED "-javaagent:C:Program FilesJetBrainsIntelliJ IDEA Ultimate Edition 2020.3libidea_rt.jar=56278:C:Program FilesJetBrainsIntelliJ IDEA Ultimate Edition 2020.3in" -Dfile.encoding=UTF-8 -classpath "E:DocumentsArnobAssignmentCSE 4402JAVAFXoutproductionJAVAFX;C:Program FilesJavajavafx-sdk-15.0.1libsrc.zip;C:Program FilesJavajavafx-sdk-15.0.1libjavafx-swt.jar;C:Program FilesJavajavafx-sdk-15.0.1libjavafx.web.jar;C:Program FilesJavajavafx-sdk-15.0.1libjavafx.base.jar;C:Program FilesJavajavafx-sdk-15.0.1libjavafx.fxml.jar;C:Program FilesJavajavafx-sdk-15.0.1libjavafx.media.jar;C:Program FilesJavajavafx-sdk-15.0.1libjavafx.swing.jar;C:Program FilesJavajavafx-sdk-15.0.1libjavafx.controls.jar;C:Program FilesJavajavafx-sdk-15.0.1libjavafx.graphics.jar;E:DocumentsArnobAssignmentCSE 4402JAVAFXsrcLab06_1Bjfoenix-9.0.10.jar;E:DocumentsArnobProjectCSE 4402MEDI-COLLABsrcResourcescharm-glisten-4.4.1.jar" Practice.Main
Exception in Application start method
java.lang.reflect.InvocationTargetException
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:564)
at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(LauncherImpl.java:464)
at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplication(LauncherImpl.java:363)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:564)
at java.base/sun.launcher.LauncherHelper$FXHelper.main(LauncherHelper.java:1071)
Caused by: java.lang.RuntimeException: Exception in Application start method
at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:900)
at javafx.graphics/com.sun.javafx.application.LauncherImpl.lambda$launchApplication$2(LauncherImpl.java:195)
at java.base/java.lang.Thread.run(Thread.java:832)
Caused by: java.lang.IllegalAccessError: class com.gluonhq.impl.charm.a.b.b.c.b (in unnamed module @0x28bbe400) cannot access class com.sun.javafx.collections.SourceAdapterChange (in module javafx.base) because module javafx.base does not export com.sun.javafx.collections to unnamed module @0x28bbe400
at com.gluonhq.impl.charm.a.b.b.c.b.sourceChanged(SourceFile:106)
at javafx.base/javafx.collections.transformation.TransformationList.lambda$getListener$0(TransformationList.java:106)
at javafx.base/javafx.collections.WeakListChangeListener.onChanged(WeakListChangeListener.java:88)
at javafx.base/com.sun.javafx.collections.ListListenerHelper$SingleChange.fireValueChangedEvent(ListListenerHelper.java:164)
at javafx.base/com.sun.javafx.collections.ListListenerHelper.fireValueChangedEvent(ListListenerHelper.java:73)
at javafx.base/javafx.collections.ObservableListBase.fireChange(ObservableListBase.java:233)
at javafx.base/javafx.collections.transformation.SortedList.sourceChanged(SortedList.java:114)
at javafx.base/javafx.collections.transformation.TransformationList.lambda$getListener$0(TransformationList.java:106)
at javafx.base/javafx.collections.WeakListChangeListener.onChanged(WeakListChangeListener.java:88)
at javafx.base/com.sun.javafx.collections.ListListenerHelper$Generic.fireValueChangedEvent(ListListenerHelper.java:329)
at javafx.base/com.sun.javafx.collections.ListListenerHelper.fireValueChangedEvent(ListListenerHelper.java:73)
at javafx.base/javafx.collections.ObservableListBase.fireChange(ObservableListBase.java:233)
at javafx.base/javafx.collections.ListChangeBuilder.commit(ListChangeBuilder.java:482)
at javafx.base/javafx.collections.ListChangeBuilder.endChange(ListChangeBuilder.java:541)
at javafx.base/javafx.collections.ObservableListBase.endChange(ObservableListBase.java:205)
at javafx.base/javafx.collections.ModifiableObservableListBase.setAll(ModifiableObservableListBase.java:90)
at javafx.base/javafx.beans.binding.ListExpression.setAll(ListExpression.java:378)
at javafx.base/com.sun.javafx.binding.ContentBinding.bind(ContentBinding.java:53)
at javafx.base/javafx.beans.binding.Bindings.bindContent(Bindings.java:1132)
at com.gluonhq.impl.charm.a.b.b.g.<init>(SourceFile:41)
at com.gluonhq.charm.glisten.control.CardPane.createDefaultSkin(SourceFile:95)
at javafx.controls/javafx.scene.control.Control.doProcessCSS(Control.java:897)
at javafx.controls/javafx.scene.control.Control$1.doProcessCSS(Control.java:89)
at javafx.controls/com.sun.javafx.scene.control.ControlHelper.processCSSImpl(ControlHelper.java:67)
at javafx.graphics/com.sun.javafx.scene.NodeHelper.processCSS(NodeHelper.java:145)
at javafx.graphics/javafx.scene.Parent.doProcessCSS(Parent.java:1400)
at javafx.graphics/javafx.scene.Parent$1.doProcessCSS(Parent.java:125)
at javafx.graphics/com.sun.javafx.scene.ParentHelper.processCSSImpl(ParentHelper.java:98)
at javafx.graphics/com.sun.javafx.scene.NodeHelper.processCSS(NodeHelper.java:145)
at javafx.graphics/javafx.scene.Node.processCSS(Node.java:9544)
at javafx.graphics/javafx.scene.Scene.doCSSPass(Scene.java:569)
at javafx.graphics/javafx.scene.Scene.preferredSize(Scene.java:1747)
at javafx.graphics/javafx.scene.Scene$2.preferredSize(Scene.java:393)
at javafx.graphics/com.sun.javafx.scene.SceneHelper.preferredSize(SceneHelper.java:66)
at javafx.graphics/javafx.stage.Window$12.invalidated(Window.java:1086)
at javafx.base/javafx.beans.property.BooleanPropertyBase.markInvalid(BooleanPropertyBase.java:110)
at javafx.base/javafx.beans.property.BooleanPropertyBase.set(BooleanPropertyBase.java:145)
at javafx.graphics/javafx.stage.Window.setShowing(Window.java:1174)
at javafx.graphics/javafx.stage.Window.show(Window.java:1189)
at javafx.graphics/javafx.stage.Stage.show(Stage.java:273)
at Practice.Main.start(Main.java:32)
at javafx.graphics/com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$9(LauncherImpl.java:846)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runAndWait$12(PlatformImpl.java:455)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:428)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:391)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$11(PlatformImpl.java:427)
at javafx.graphics/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:96)
at javafx.graphics/com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at javafx.graphics/com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(WinApplication.java:174)
... 1 more
Exception running application Practice.Main
Process finished with exit code 1
Now, my question is that is there something I should add in the VM options? Or, can I not use gluon with JavaFX like this? Or, is there any way to run the JavaFX project with gluon charms tools?
question from:https://stackoverflow.com/questions/66065032/how-can-i-use-gluon-charms-with-javafx