0

I've tried a lot to add jFoenix to IntelliJ but I didn't succeed to do so. I saw many youtube videos and read posts from various websites but all didn't work.

I'm using jFoenix regularly in my Scene Builder version 8.0.5 but still when I try to activate it in IntelliJ it doesn't work at all. Here is my XML code:

<?xml version="1.0" encoding="UTF-8"?>

<?import com.jfoenix.controls.JFXButton?>
<?import com.jfoenix.controls.JFXPasswordField?>
<?import com.jfoenix.controls.JFXTextField?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.effect.Bloom?>
<?import javafx.scene.effect.InnerShadow?>
<?import javafx.scene.image.Image?>
<?import javafx.scene.image.ImageView?>
<?import javafx.scene.layout.AnchorPane?>
<?import javafx.scene.text.Font?>


<AnchorPane prefHeight="576.0" prefWidth="1050.0" style="-fx-background-color: #20120F;" xmlns="http://javafx.com/javafx/8.0.171" xmlns:fx="http://javafx.com/fxml/1" fx:controller="Controller.SignInController">
   <children>
      <AnchorPane layoutX="639.0" layoutY="88.0" prefHeight="400.0" prefWidth="350.0" style="-fx-background-color: #9C2B27;">
         <children>
            <JFXTextField focusColor="#d4af37" layoutX="50.0" layoutY="135.0" prefWidth="250.0" promptText="Username / E-mail" unFocusColor="#c3b7b7" />
            <JFXPasswordField focusColor="#d4af37" layoutX="50.0" layoutY="222.0" prefWidth="250.0" promptText="Password" unFocusColor="#c3b7b7" />
            <JFXButton layoutX="50.0" layoutY="312.0" prefWidth="250.0" style="-fx-background-color: #E45652;" text="Sign In" textFill="#dad6d6">
               <effect>
                  <Bloom threshold="0.0" />
               </effect>
               <font>
                  <Font name="System Bold" size="12.0" />
               </font>
            </JFXButton>
            <Label layoutX="122.0" layoutY="52.0" text="Sign In" textFill="WHITE">
               <font>
                  <Font name="Cambria" size="36.0" />
               </font>
               <effect>
                  <InnerShadow />
               </effect>
            </Label>
         </children>
      </AnchorPane>
      <ImageView fitHeight="576.0" fitWidth="576.0" opacity="0.2" pickOnBounds="true" preserveRatio="true">
         <image>
            <Image url="@../../Image/TG_Background.jpg" />
         </image>
      </ImageView>
      <Label layoutX="55.0" layoutY="131.0" text="Don't Have An Account? No Problem&#10;Sign Up Now And Enjoy Our&#10;Variety Of Features" textAlignment="CENTER" textFill="WHITE">
         <font>
            <Font name="Cambria" size="30.0" />
         </font>
         <effect>
            <Bloom threshold="0.0" />
         </effect>
      </Label>
      <JFXButton layoutX="212.0" layoutY="266.0" prefHeight="44.0" prefWidth="153.0" style="-fx-background-color: #E45652;" text="Sign Up" textFill="#dad6d6">
         <effect>
            <Bloom threshold="0.0" />
         </effect>
         <font>
            <Font name="System Bold" size="18.0" />
         </font>
      </JFXButton>
   </children>
</AnchorPane>

Also, I tried to import the jFoenix using the JAR or a Maven dependency and when I do so the jFoenix library becomes recognized by IntelliJ but still can't run:

Defined jFoenix Library

If anyone could help I'll be thankful.

Mohamad S.
  • 199
  • 1
  • 9
  • Does this answer your question? [JFoenix v8 or v9 not running in Intellij](https://stackoverflow.com/questions/62533777/jfoenix-v8-or-v9-not-running-in-intellij) – Giovanni Contreras Apr 19 '22 at 15:34
  • @GiovanniContreras No, when I write what he wrote I get this error: https://ibb.co/mvRzpb3 – Mohamad S. Apr 19 '22 at 17:11
  • you can add the output console to your post : Error ocurred during init.......... – Giovanni Contreras Apr 19 '22 at 17:22
  • SceneBuilder 8.0.5 is obosolete. Use recent stable versions of all software (IDE, jfoenix, SceneBuilder, JavaFX, JDK). – jewelsea Apr 19 '22 at 19:28
  • Do not screenshot text for code, post it in the question, formatted as code. – jewelsea Apr 19 '22 at 19:29
  • I succeed to use the jFoenix but now I have a problem when I try to insert JFXTextField, it goes regularly in the Scene Builder but makes errors when I try to run it in IntelliJ. – Mohamad S. Apr 19 '22 at 19:30
  • Post the stack trace or error message in the question formatted as code. But likely help with obsolete software will be limited. There may be cases where [jfoenix does not work with recent JavaFX distributions](https://stackoverflow.com/questions/70082473/working-with-javafx-in-maven-jfoenix-9-0-10-dependency-issue/70086754#70086754) (I don't know if that will impact you). – jewelsea Apr 19 '22 at 19:36
  • Some related question: [using jfoenix with recent scenebuilder versions](https://stackoverflow.com/questions/70985646/load-custom-components-in-scenebuilder-17/70988201#70988201). Building an app with [jfoenix](https://stackoverflow.com/questions/70998383/class-not-found-java/71003905#71003905) (this includes some packaging steps which you probably don't need at the moment). You will need to have correct dependency versions of your libraries in pom.xml and require the right module names in module-info.java for JavaFX 11+. – jewelsea Apr 19 '22 at 19:38

1 Answers1

1

create your project using Mavan and then add jfoenix dependency in pom.xml file
like here:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>org.example</groupId>
    <artifactId>prjname</artifactId>
    <version>1.0-SNAPSHOT</version>
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.6.1</version>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <properties>
        <maven.compiler.target>1.8</maven.compiler.target>
        <maven.compiler.source>1.8</maven.compiler.source>
    </properties>
<dependencies>
    <!-- https://mvnrepository.com/artifact/org.openjfx/javafx -->
    <dependency>
        <groupId>org.openjfx</groupId>
        <artifactId>javafx</artifactId>
        <version>11</version>
        <type>pom</type>
    </dependency>

    <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>4.12</version>
        <scope>test</scope>
    </dependency>
    <!-- https://mvnrepository.com/artifact/com.jfoenix/jfoenix -->
    <dependency>
        <groupId>com.jfoenix</groupId>
        <artifactId>jfoenix</artifactId>
        <version>9.0.1</version>
    </dependency>

</dependencies>
</project>

in this pom.xml file add com.jfoenix, org.openjfx and junit dependency

MMR
  • 69
  • 1
  • 7