I have looked online and found that they are located in the jme3-libraries jar files. I would like to load them in my XML files, if possible. If I try that code in my XML file, however, I get an asset not found exception. Without those lines, the XML loads fine if I remove the control.
Is the only way to load them is by copy-pasting them in my Interface folder? It seems rather archaic, so I figured there might be another way I’m not seeing.
SEVERE: Uncaught exception thrown in Thread[LWJGL Renderer Thread,5,main]
java.lang.RuntimeException: com.jme3.asset.AssetNotFoundException: Interface/Editor.xml
at de.lessvoid.nifty.Nifty.loadFromFile(Nifty.java:577)
at de.lessvoid.nifty.Nifty.fromXml(Nifty.java:480)
at editor.Editor.<init>(Editor.java:23)
at main.Main.simpleInitApp(Main.java:29)
at com.jme3.app.SimpleApplication.initialize(SimpleApplication.java:226)
at com.jme3.system.lwjgl.LwjglAbstractDisplay.initInThread(LwjglAbstractDisplay.java:130)
at com.jme3.system.lwjgl.LwjglAbstractDisplay.run(LwjglAbstractDisplay.java:207)
at java.lang.Thread.run(Thread.java:744)
Caused by: com.jme3.asset.AssetNotFoundException: Interface/Editor.xml
at com.jme3.niftygui.NiftyJmeDisplay$ResourceLocationJme.getResourceAsStream(NiftyJmeDisplay.java:82)
at de.lessvoid.nifty.tools.resourceloader.NiftyResourceLoader.getResourceAsStream(NiftyResourceLoader.java:65)
at de.lessvoid.nifty.Nifty.getResourceAsStream(Nifty.java:1583)
at de.lessvoid.nifty.Nifty.loadFromFile(Nifty.java:569)
... 7 more
As I said, if I remove the tag, it still fails to work. The problem, I believe, is that the nifty-default-styles.xml and nifty-default-controls.xml are not found - obviously because they are not in the same directory.
I considered copy-pasting those two files into the Interface directory, but they themselves require more files.
“These files are in the jar files.” “I fail to find them.”
Indicates that you have failed to include the jars files as dependencies? But I feel like there is a missing “but” in there as to why exactly you don’t want to include the jar files.
Sorry, I think I didn’t do a good job of explaining. I have located the .jar files (in the Libraries folder). Simply put, I don’t know how to include the style files in those libraries from my nifty XML file.
I think that is what I’m doing wrong. Below is my libraries folder in Tree view. If I understood you well, the classpath for the libraries is this: C:/Program Files/jmonkeyplatform/jmonkeyplatform/libs/.
And the jar with the default styles was actually part of your dependencies at that point?
I mean, beyond this I can’t really help. There is no magic to JME’s asset loader. If it says “foo” was not found then it means that “foo” is not on the classpath. AssetNotFoundException is pretty easy to debug like that.
Yes, it was. Aren’t dependencies set automatically with the Simple Application template? Not even copy-pasting a control example from the manual works for some reason.
What makes this particularly difficult to debug is that the exception looks like this:
SEVERE: Uncaught exception thrown in Thread[LWJGL Renderer Thread,5,main]
java.lang.RuntimeException: com.jme3.asset.AssetNotFoundException: Interface/Editor.xml
at de.lessvoid.nifty.Nifty.loadFromFile(Nifty.java:577)
at de.lessvoid.nifty.Nifty.fromXml(Nifty.java:480)
at editor.Editor.<init>(Editor.java:23)
at main.Main.simpleInitApp(Main.java:29)
at com.jme3.app.SimpleApplication.initialize(SimpleApplication.java:226)
at com.jme3.system.lwjgl.LwjglAbstractDisplay.initInThread(LwjglAbstractDisplay.java:130)
at com.jme3.system.lwjgl.LwjglAbstractDisplay.run(LwjglAbstractDisplay.java:207)
at java.lang.Thread.run(Thread.java:744)
Caused by: com.jme3.asset.AssetNotFoundException: Interface/Editor.xml
at com.jme3.niftygui.NiftyJmeDisplay$ResourceLocationJme.getResourceAsStream(NiftyJmeDisplay.java:82)
at de.lessvoid.nifty.tools.resourceloader.NiftyResourceLoader.getResourceAsStream(NiftyResourceLoader.java:65)
at de.lessvoid.nifty.Nifty.getResourceAsStream(Nifty.java:1583)
at de.lessvoid.nifty.Nifty.loadFromFile(Nifty.java:569)
... 7 more
I think that’s the problem, the thing I haven’t done. The Editor.xml file is being found, because it is loaded correctly once I remove the useStyles and useControls lines. Could you please tell me how to do that if it’s not much of a bother? I have previously downloaded the Nifty 1.4.2 zip and jar files.
Someone else will have to provide nifty support. I dropped nifty like a bad habit 6+ years ago and would rather gouge out my eyes with rusty forks than deal with it again.