Errors when trying to use JFXPasswordField Jfoenix JAVA

与世无争的帅哥 提交于 2019-12-24 20:32:58

问题


I'm trying to create some GUI with Jfoenix and I'm getting following errors when i run them. I'm not understanding the errors and i have spent the whole day please guide me.

<?xml version="1.0" encoding="UTF-8"?>
<?import com.jfoenix.controls.JFXPasswordField?>
<?import com.jfoenix.controls.JFXTextField?>
<?import javafx.scene.layout.AnchorPane?>

<AnchorPane id="AnchorPane" prefHeight="400.0" prefWidth="700.0" style="-fx-background-color: #20120F;" xmlns="http://javafx.com/javafx/9" xmlns:fx="http://javafx.com/fxml/1" fx:controller="client_side.FXMLDocumentController">
<children>
  <AnchorPane layoutX="380.0" layoutY="34.0" prefHeight="333.0" prefWidth="306.0" style="-fx-background-color: #9c2827;">
     <children>
        <JFXTextField focusColor="#3cc656" layoutX="79.0" layoutY="93.0" promptText="Email" style="-fx-prompt-text-fill: #c3b7b7;" unFocusColor="#c3b7b7" />
        <JFXPasswordField focusColor="#3cc656" layoutX="86.0" layoutY="181.0" promptText="Password" style="-fx-prompt-text-fill: #c3b7b7;" unFocusColor="#c3b7b7" />
     </children>
  </AnchorPane>
</children>

and errors

https://pastebin.com/hwb0K304


回答1:


This usually occurs when you use the wrong jdk and jfoenix combination (eg : using jdk8 with jfoenix 9 or jdk9 with jfoenix) To prevent this, if you are using jdk 8, please use the jfoenix library , or jdk 9 with jfoenix for java 9 from here :

Download JFoenix

It will most likely fix your error




回答2:


Perform these steps in order:

1) Remove the current JFoenix lib jar from SceneBuilder and from Eclipse/ InteliJ / NetBeans.

2) Download JFoenix for Java 8 and add it to SceneBuilder and your IDE. You can download the JFoenix Java 8 file from here: JFoenix Java 8 JAR file



来源:https://stackoverflow.com/questions/47003684/errors-when-trying-to-use-jfxpasswordfield-jfoenix-java

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!