Looking for examples of Nifty Gui + JOGL2

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Looking for examples of Nifty Gui + JOGL2

juankprada
Hello guys,

I've been trying to make nifty work with JOGL without success: Right now my initialization code for nifty is as follows:

         inputSystem = new JoglInputSystem();

        niftyGuI = new Nifty(
                new JoglRenderDevice();,
                null,
                inputSystem,
                new AccurateTimeProvider()
        );



but I keep getting this exception: Exception in thread "main" java.lang.NoClassDefFoundError: org/bushe/swing/event/EventService
        at com.soa.game.Game.onStart(Game.java:70)
        at com.soa.game.Main.main(Main.java:9)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:601)
        at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)
Caused by: java.lang.ClassNotFoundException: org.bushe.swing.event.EventService
        at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:356)

There must be something I am doing very wrong, but i coulndt find any information about how to work with nifty and JOGL.
so, do you know whats my issue here, or do you know of some tutorial I can work with?

Best regards
Reply | Threaded
Open this post in threaded view
|

Re: Looking for examples of Nifty Gui + JOGL2

gouessej
Administrator
Hi

At first, you can simply use the provided examples and replace the class relying on the competitor of JOGL by ours as you already did in your short piece of code.

Secondly, you're not in the wrong way, you see a class is not found, there is something wrong with your classpath, you have to add the dependencies of Nifty GUI into it (at least eventbus.jar, xpp3, easymock and esamockextension). I have just noticed that they moved to Maven which basically means that they don't provide the JARs of their dependencies. I admit it is becoming tricky now. Can you rather use Maven to build Nifty GUI?
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: Looking for examples of Nifty Gui + JOGL2

juankprada
thanks goussej, now everything works. Nowere in the nifty website said anything about the dependencies.

Regars.
Reply | Threaded
Open this post in threaded view
|

Re: Looking for examples of Nifty Gui + JOGL2

gouessej
Administrator
When you use Maven, the dependencies are automatically downloaded, that's why they don't need to be mentioned. If you really need to download them, you can just look at the files used by Maven (pom.xml).
Julien Gouesse | Personal blog | Website