Hi guys,
I’m trying to construct a GUI with Nifty and have been following a few tutorials on how to do so (namely: http://wiki.jmonkeyengine.org/doku.php/jme3:advanced:nifty_gui_java_layout which I found really useful).
I’m at the stage where I want to add a TextField - since I’m constructing my GUI in Java I’m using the TextFieldBuilder, but encounter a run-time warning, the result effect of which is that my TextField - although it renders - does not seem to respond to input:
WARNING: class [de.lessvoid.nifty.controls.textfield.controller.TextFieldControl] could not be instantiated (java.lang.ClassNotFoundException: de.lessvoid.nifty.controls.textfield.controller.TextFieldControl)
I looked into the dependency in question (nifty-default-controls) and it looks like the package structure changed in version 1.3:
de.lessvoid.nifty.controls.textfield.controller.TextFieldControl (pre v1.3)
de.lessvoid.nifty.controls.textfield.TextFieldControl (v.1.3+)
Now I’m using Maven to pull in all the revelant JME3 dependencies, the relevant section of my POM looks like this:
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<jme.version>3.0.10</jme.version>
</properties>
<dependencies>
<dependency>
<groupId>com.r2k</groupId>
<artifactId>realms-of-kadia-transport</artifactId>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.jme3</groupId>
<artifactId>jme3-core</artifactId>
<version>${jme.version}</version>
</dependency>
<dependency>
<groupId>com.jme3</groupId>
<artifactId>jme3-desktop</artifactId>
<version>${jme.version}</version>
</dependency>
<dependency>
<groupId>com.jme3</groupId>
<artifactId>jme3-lwjgl</artifactId>
<version>${jme.version}</version>
</dependency>
<dependency>
<groupId>com.jme3</groupId>
<artifactId>jme3-niftygui</artifactId>
<version>${jme.version}</version>
</dependency>
<dependency>
<groupId>org.bushe</groupId>
<artifactId>eventbus</artifactId>
<version>1.4</version>
</dependency>
<dependency>
<groupId>com.esotericsoftware</groupId>
<artifactId>kryonet</artifactId>
<version>2.22.0-RC1</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.12</version>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-core</artifactId>
<version>1.1.3</version>
</dependency>
</dependencies>
<repositories>
<repository>
<id>jme3-repo</id>
<url>http://updates.jmonkeyengine.org/maven/</url>
</repository>
<repository>
<id>nifty-repo</id>
<url>http://nifty-gui.sourceforge.net/nifty-maven-repo/</url>
</repository>
</repositories>
It would seem that somewhere within the depths of one of these dependencies there is a reference to an older version of the nifty JAR than that which I am using (only version 1.3.3 gets inherited from the above dependencies).
I’ve tried manually excluding the v1.3.3 nifty dependencies and manually pulling down v1.2 but this breaks a large chunk of my code which evidently seems to be using some of the newer features (e.g.: nifty.loadStyleFile(“nifty-default-styles.xml”); is not valid in v1.2.
Does anybody have any experience with this or suggestions on how else I could circumvent the problem?
Many thanks in advance!