Nifty File Problem

Hi guys, I’ve been trying to implement a gui into my project I am working on and it is not working out well. It is not understanding the xml which is a problem but its the packages that you need to end up running the gui which is a major problem for me. I’ve been trying to implement basic things like buttons and textfields in my gui but it seems like I am always missing packages so I end up going to github and downloading the packages I need but I simply always seem to need more. Now I’ve gotten to a point where I think I have all the packages downloaded but it seems like I do not have some classes that should be in my packages. This is wierd because I downloaded the latest version of nifty and I am still getting errors saying I dont have these files. I didn’t want to post this question because I’m sure I missed something very basic somewhere in the manual but I am just tired of spending all this time trying to get something basic like a button to work and having it simply not even show up.

Here is so info down below (I was going to upload pictures but it seems like it gets stuck uploading at 100% for some reason…)
Here are all the jar files I have downloaded to try to get Nifty to work:

eventbus-1.4.jar
jme3-niftygui-3.2.0-v3.2-prealpha-sdk1-SNAPSHOT.jar
xpp3-1.1.4c.jar
nifty-default-styles-0.0.1.jar
nifty-default-controls-1.4.2.jar
nifty-1.4.2.jar

Here is the errors I am getting in the console window :frowning:

Jun 11, 2017 7:50:27 PM de.lessvoid.nifty.loaderv2.types.EffectType getRegisteredEffectType
WARNING: unable to convert effect [hoverColorBar] because no effect with this name has been registered.
Jun 11, 2017 7:50:27 PM de.lessvoid.xml.tools.ClassHelper getInstance
WARNING: class [de.lessvoid.nifty.input.mapping.StandardTextField] could not be instantiated (java.lang.ClassNotFoundException: de.lessvoid.nifty.input.mapping.StandardTextField)
Jun 11, 2017 7:50:27 PM de.lessvoid.nifty.loaderv2.types.EffectType getRegisteredEffectType
WARNING: unable to convert effect [hoverImageOverlay] because no effect with this name has been registered.
Jun 11, 2017 7:50:27 PM de.lessvoid.nifty.controls.textfield.TextFieldControl bind
WARNING: Locating the text element of the text field failed. Looked for: #text
Jun 11, 2017 7:50:27 PM de.lessvoid.nifty.controls.textfield.TextFieldControl bind
WARNING: Locating the field element of the text field failed. Looked for: #field
Jun 11, 2017 7:50:27 PM de.lessvoid.nifty.controls.textfield.TextFieldControl bind
WARNING: Locating the cursor element of the text field failed. Looked for: #cursor
Jun 11, 2017 7:50:27 PM de.lessvoid.nifty.controls.button.ButtonControl bind
SEVERE: Button element misses the text content element.

Here is my xml file. The text fields, layers, and panels are all working fine. I wish I could say the same for my button and textfield though :confounded:

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

<nifty xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://nifty-gui.lessvoid.com/nifty-gui" xsi:schemaLocation="https://raw.githubusercontent.com/void256/nifty-gui/1.4/nifty-core/src/main/resources/nifty.xsd https://raw.githubusercontent.com/void256/nifty-gui/1.4/nifty-core/src/main/resources/nifty.xsd">

<useControls filename="nifty-default-controls.xml"/>
<useStyles filename="nifty-default-styles.xml"/>
<screen id="default" controller="mygame.OptionsController">
    <layer id="GLayer0" childLayout="center">
        <panel id="GPanel0" childLayout="absolute" backgroundImage="Images/Background/generalOptionsBackground.png" width="300" x="0" y="0" style="nifty-panel-simple" height="400">
            <text font="Fonts/Default.fnt" color="#ffff" text="Test1:" x="10%" y="10%"/>
            <text font="Fonts/Default.fnt" color="#ffff" text="Test2:" x="10%" y="20%"/>
            <text font="Fonts/Default.fnt" color="#ffff" text="Test3:" x="10%" y="30%"/>
            <text font="Fonts/Default.fnt" color="#ffff" text="Test4:" x="10%" y="40%"/>
            
            <control name="textfield" x="50%" y="10%" id="testID"/>
            <control id="appendButton" name="button" label="Append" x="50%" y="20%"/>
        </panel>
        
    </layer>
</screen>
1 Like

Im not studying GUI yet so the best I can do is list 3.1-stable jars since it looks like your trying to go for the latest build, for comparison sake.

jme3-niftygui-3.1.0-stable
xpp3-1.1.4c.jar
jsr305-2.0.2.jar
nifty-1.4.2.jar
nifty-default-controls-1.4.2.jar
nifty-style-black-1.4.2.jar

1 Like

I would suggest Gradle. The just configure like so:

Thank you so much guys. It looks like I was missing the jsr305 jar and was using a way outdated nifty-style jar. My gui now works and looks wonderful :slight_smile: