Hi all,
I tried to build up a nifty gui with jmonkeyplatform. Everything work fine until i try to add a second screen. The same thing append when i close jmonkeyplatform and open it again.
The gui is not displaying in the design panel (Worked before i close the application) and i’m getting en error in the bottom
org.xml.sax.SAXParseException: Element type “control” must be followed by either attribute specifications, “>” or “/>”.
at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:249)
at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:284)
at org.openide.xml.XMLUtil.parse(XMLUtil.java:352)
[catch] at com.jme3.gde.gui.multiview.NiftyPreviewPanel.updatePreView(NiftyPreviewPanel.java:119)
at com.jme3.gde.gui.multiview.NiftyPreviewPanel.updatePreView(NiftyPreviewPanel.java:110)
…
I’ve check every control tag and i didn’t found the error.
Here is my nifty xml
[xml]<?xml version=“1.0” encoding=“UTF-8”?>
<nifty xmlns=“http://nifty-gui.sourceforge.net/nifty.xsd” xmlns:xsi=“http://www.w3.org/2001/XMLSchema-instance” xsi:schemaLocation=“http://nifty-gui.sourceforge.net/nifty.xsd http://nifty-gui.sourceforge.net/nifty.xsd”>
<useStyles filename=“nifty-default-styles.xml” />
<useControls filename=“nifty-default-controls.xml” />
<screen id=“login”>
<layer id=“background” childLayout=“center”>
<image id=“loginImage” width=“100%” height=“100%” filename=“Images/background-login.jpg” align=“center” />
</layer>
<layer id=“foreground” childLayout=“center”>
<panel id=“panel” height=“110px” width=“200px” align=“center” valign=“center” backgroundColor="#0000" childLayout=“absolute” visibleToMouse=“true”>
<effect>
<onStartScreen name=“move” mode=“in” direction=“top” length=“400” startDelay=“0” inherit=“true” />
<onEndScreen name=“move” mode=“out” direction=“top” length=“300” startDelay=“0” inherit=“true” />
</effect>
<control name=“label” id=“UsernameLabel” text=“Username : " height=“20px” width=“80px” x=“20px” y=“10px” textHAlign=“left” />
<control name=“label” id=“PasswordLabel” text=“Password : " height=“20px” width=“80px” x=“20px” y=“40px” textHAlign=“left” />
<control name=“textfield” id=“Username” width=“120px” height=“20px” x=“120px” y=“10px” />
<control name=“textfield” id=“Password” width=“120px” height=“20px” x=“120px” y=“40px” passwordChar=”*” />
<control name=“button” id=“CreateButton” label=“Create"width=“100px” height=“20px” x=“10px” y=“100px”>
<interact onClick=“showCreate()”/>
</control>
<control name=“button” id=“LoginButton” label=“Login"width=“100px” height=“20px” x=“140px” y=“100px”>
<interact onClick=“login()”/>
</control>
<control name=“label” id=“Message” text=“TEST_MESSAGE” height=“30px” width=“400px” x=”-50px” y="-30px" textHAlign=“left” />
</panel>
</layer>
<layer id=“VersionLayer” childLayout=“absolute”>
<control name=“label” id=“Version” text=“Version: DEMO” height=“20px” width=“150px” x=“100px” y=“92%” textHAlign=“left”/>
</layer>
</screen>
</nifty>
[/xml]
It’s ok. I found the error.
[xml]<control name=“button” id=“CreateButton” label="Create"width=“100px” height=“20px” x=“10px” y=“100px”>
<interact onClick=“showCreate()”/>
</control>
<control name=“button” id=“LoginButton” label="Login"width=“100px” height=“20px” x=“140px” y=“100px”>
<interact onClick=“login()”/>
</control>[/xml]
both have an error on the parameter → label="Login"width=“100px”. Need a space between.