appgc.setResizable(true); error

179 views Asked by At

So I've been making a game for a while now. Recently I ecnountered an error saying

 "Exception in thread "main" java.lang.Error: Unresolved compilation problem: 
    The method setResizable(boolean) is undefined for the type AppGameContainer

at felix.riskminer.game.MainGame.main(MainGame.java:1760)"

This started happening as soon as I added appgc.setResizable(true); to the code.

The problem is that if I remove it I get a bunch of other errors. Any fix?

With appgc.setResizable(true);

Exception in thread "main" java.lang.Error: Unresolved compilation problem: 
    The method setResizable(boolean) is undefined for the type AppGameContainer

at felix.riskminer.game.MainGame.main(MainGame.java:1760)

without appgc.setResizable(true);

Exception in thread "main" java.lang.UnsatisfiedLinkError: no lwjgl64 in java.library.path
    at java.lang.ClassLoader.loadLibrary(Unknown Source)
    at java.lang.Runtime.loadLibrary0(Unknown Source)
    at java.lang.System.loadLibrary(Unknown Source)
    at org.lwjgl.Sys$1.run(Sys.java:72)
    at java.security.AccessController.doPrivileged(Native Method)
    at org.lwjgl.Sys.doLoadLibrary(Sys.java:66)
    at org.lwjgl.Sys.loadLibrary(Sys.java:87)
    at org.lwjgl.Sys.<clinit>(Sys.java:117)
    at org.lwjgl.opengl.Display.<clinit>(Display.java:135)
    at org.newdawn.slick.AppGameContainer$1.run(AppGameContainer.java:39)
    at java.security.AccessController.doPrivileged(Native Method)
    at org.newdawn.slick.AppGameContainer.<clinit>(AppGameContainer.java:36)
    at felix.riskminer.game.MainGame.main(MainGame.java:1759)

LIBRARIES THAT ARE BEING USED: Slick2D and LWJGL

Thanks in advance.

1

There are 1 answers

0
RPresle On

For missing setResiable method: I can't find this method in the official documentation. It may depends on the version of slick you're using. To correct this you can go for this solution posted here

In your StateBasedGame, in your main method, you can call lwjgl's Display object,

Display.setResizable(true);

This will allow you to resize/maximize the Display window. Make sure you have a recent version of lwjgl!

Check lwjgl jar and native, restart your IDE and come back if you still have problem with classloading.