Slick TextField not working

北城以北 提交于 2019-12-05 16:12:04

Your problem is how you are going about StateBasedGames in slick. If you refer to my wiki entry here: http://slick.ninjacave.com/wiki/index.php?title=Game_States

You will notice that in the initStatesList() method, I only use this.addState(new StateName()). This is because of what addState() method does. It calls the init method for you, so there is no need to do getState() or enterState() in the top level Application class (Game.java in your case).

To summarize how to fix your problem, remove everything in your initStatesList() method, then move this.addState(new TextFieldTest(TextFieldTestNum)); from your main constructor to your initStatesList() method.

Once I corrected that in your program, it ran just fine for me.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!