简体   繁体   中英

How to implement Login Dialog in JavaFX using ControlsFX

I tried to use custom dialog from http://controlsfx.bitbucket.org/org/controlsfx/dialog/Dialog.html , but the code is not working throwing this exception

java.lang.NoClassDefFoundError: com/sun/javafx/scene/traversal/ParentTraversalEngine
at org.controlsfx.control.ButtonBar.<init>(ButtonBar.java:414)
at org.controlsfx.control.ButtonBar.<init>(ButtonBar.java:357)
at org.controlsfx.dialog.Dialog.createButtonPanel(Dialog.java:1034)
at org.controlsfx.dialog.Dialog.createCenterPanel(Dialog.java:1029)
at org.controlsfx.dialog.Dialog.buildDialogContent(Dialog.java:950)
at org.controlsfx.dialog.Dialog.show(Dialog.java:320)
....

The other thing is there is no example of how to integrate this to be used in a real world application, as of where do you put this code to authenticate user then continue loading your application, and maybe how to use this code to authenticate in the middle of an action, thus needs to be more re-usable.

I am using Java 8.0u20 and ControlsFX 8.0.6_20 from maven

Check your Java version, most likely you're running with an older version than 8u20.

You can add this line to your app to check at runtime which JRE is being used.

System.out.println(System.getProperty("java.version"));

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM