[SOLVED] Nifty Button wont work

Hello! I added was doing the Nifty loading tutorial and tried to run it.



Link to tutorial: https://wiki.jmonkeyengine.org/legacy/doku.php/jme3:advanced:loading_screen?s[]=loading&s[]=screen





I have added all the relevant JAR files and it can read the nifty (the button can load) but nothing happens when I click the button “Load Game” and the method “showLoadingMenu()” is not run.



I have a feeling it has to do with the ScreenController… I tried troubleshooting many things but it still does not seem to work.



Anyone have any solutions?

what did you put to replace the [java]controller = "jme3test.TestLoadingScreen"[/java] lines in your xml?

Update: When i add a actionListener to activate the loadlevel screen (bypass the button) , it loads the terrain but does not have any loading bar…

@cghislai I did not change it. the XML file is as it is.



Update: The actionListener method above works and the loading screen is displayed properly. So its not back to the button question! Thanks

Well, you understand that this jme3test.TestLoadingScreen is the class name of your controller, meaning nifty will search for a class named TestLoadingScreen in the package jme3test. If your class is located elsewhere, you should point nifty to the correct location.



Glad you managed to find a workaround though

Also you could have seen in the ocean of Nifty’s logging messages something saying that it could not find the controller class.

Woah! It works! Hahaha, i put it in a seperate package! So i just changed the Controller path to the correct one…Thanks so much :slight_smile: