Unable to get style map from asset folder

Hello mates, I am having a bit of trouble trying to access the style map from within the assets folder. I have placed the style map in a folder names “Interface”, and am trying to read it using this code:

screen = new Screen(this, "Interface/style_map.xml");

I am getting this exception:

java.lang.NullPointerException
    at tonegod.gui.core.Screen.<init>(Screen.java:268)
    at Client.Application.simpleInitApp(Application.java:277)
    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)

Which points to the line of code up above. The style_map.xml is the same as the one within the library, with no changes. Screen has been initialized, so I honestly don’t know what to do.
Thanks so much for all of your help, and have a great weekend!

I think it needs the file to be called something.gui.xml.

If not, the assetManager will find it, but it won’t be loaded by the StyleLoader.

if(!initializedLoader) {
app.getAssetManager().registerLoader(StyleLoader.class, “gui.xml”);
initializedLoader = true;
}

1 Like

That worked like a charm!
Thanks for your help, and have a great day!