[LWJGL] Which library is best for GUI and how do I change menus?

(Note: I do not know in which section this thread is the most suitable. It would be a big help if the admin would move this to a more suitable section)

I have made a game (somewhat) . Now, I have to focus on the GUI side of my game. Which library is the best and the easiest to make menus, GUI items and their events?

For now I think I would have a main menu, an options menu and the game itself. Now, I can’t switch windows for this. My entire OpenGL code is handled in the Renderer class. Back in those days when I worked in UE4, there were game states which made it easier to switch. Now, how do I “switch between menus” in Java and the helper libraries?

If you’re using LWJGL you’ll have to roll your own GameState system for different states of the game. Typically you have a main class that handles the game loop and the rendering, that delegates the rendering of the actual current stage of the game to another class implementing the behavior of the menu, game stage; etc that the player is currently in.

I haven’t found UI libraries for LWJGL that are pluggable, straightforward, and well-documented. I suggest that you roll your own, adding features that you need as you need them. It doesn’t take that long to code classes for Buttons, Labels, and Windows. Finding, learning and integrating another UI library into your renderer would likely take as long if not longer.

Could always give Nuklear a try.

Themable Widget Library looks very flexible. Never used it myself!

Hello, I am working on GUI library which based on LWJGL NanoVG bindings.


It has api similar to Swing. You can try to use it.