LWJGL 3 offers five bindings that handle window creation, user input, and native file dialogs. GLFW is the primary choice for most applications, while SDL provides a broader platform abstraction. JAWT, Native File Dialog Extended, and tinyfd fill specialized roles for AWT integration and file-picker dialogs.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/LWJGL/lwjgl3/llms.txt
Use this file to discover all available pages before exploring further.
The current stable release is 3.4.2. Use the LWJGL build configurator to generate dependency declarations for the bindings you need.
GLFW
Maven artifact:org.lwjgl:lwjgl-glfwKey classes:
GLFW, GLFWVidMode, GLFWWindowSizeCallback, GLFWErrorCallback, Callbacks
GLFW is the primary windowing and input library for LWJGL applications. It lets you create multiple windows, manage OpenGL/Vulkan contexts, handle keyboard, mouse, and gamepad input, and access multi-monitor setups — all through a clean, cross-platform API.
Capabilities:
| Feature | Notes |
|---|---|
| Window creation | Multiple windows, resizable or fixed-size, with or without decorations |
| Context management | OpenGL and Vulkan surface creation; context sharing between windows |
| Keyboard input | Key codes, scancode access, key callbacks, text input via char callbacks |
| Mouse input | Cursor position, buttons, scroll wheel, raw motion mode |
| Gamepad / joystick | Axis and button polling; gamepad mapping via SDL_GameControllerDB |
| Monitor support | Enumerate displays, query video modes, switch to fullscreen |
| Clipboard | Read and write system clipboard as UTF-8 text |
| File drag-and-drop | Receive dropped file paths via a callback |
SDL
Maven artifact:org.lwjgl:lwjgl-sdlKey classes:
SDL, SDLVideo, SDLEvents, SDLGamepad, SDLAudio, SDLRenderer
Simple DirectMedia Layer (SDL) is a cross-platform development library providing low-level access to audio, keyboard, mouse, joystick, and graphics hardware via OpenGL, Direct3D, Metal, and Vulkan. The LWJGL binding exposes SDL 3.
When to choose SDL over GLFW:
- You need SDL’s built-in audio subsystem or software renderer
- Your application targets platforms with strong SDL ecosystem support (consoles via official SDL ports)
- You want a single library that also handles audio and thread primitives
- You are porting an existing SDL application
| Subsystem | Description |
|---|---|
| Video | Window creation, OpenGL/Vulkan context, display enumeration |
| Events | Unified event queue for all input devices |
| Gamepad | Modern gamepad API with SDL_GameControllerDB mapping |
| Joystick | Low-level joystick access |
| Audio | Device enumeration, stream-based audio output |
| Renderer | 2D accelerated software/hardware renderer |
| Timer | High-resolution timer and delay utilities |
SDL and GLFW overlap significantly in windowing and input. Most LWJGL projects use GLFW because it integrates more cleanly with the LWJGL OpenGL/Vulkan context utilities. Choose SDL when you need its broader hardware abstraction or audio subsystem.
JAWT
Maven artifact:org.lwjgl:lwjgl-jawtKey classes:
JAWT, JAWTDrawingSurface, JAWTDrawingSurfaceInfo
JAWT is the Java AWT Native Interface — a standard part of the JDK that exposes native window handles for AWT components. The LWJGL binding wraps this interface so you can retrieve a native handle (HWND on Windows, Window on X11, NSView on macOS) from a Swing or AWT Canvas and use it to create an OpenGL or Vulkan context inside a traditional Java GUI application.
Typical use cases:
- Embedding an OpenGL viewport inside a Swing application (e.g., a level editor or 3D modelling tool)
- Rendering Vulkan output into an AWT panel alongside standard Java Swing widgets
- Interoperating with Java UI frameworks that manage their own window lifecycle
Native File Dialog Extended
Maven artifact:org.lwjgl:lwjgl-nfdKey classes:
NativeFileDialog, NFDFilterItem
Native File Dialog Extended (NFD) is a small C library that portably invokes native OS file-open, folder-select, and file-save dialogs. Unlike cross-platform UI toolkits that draw their own dialog, NFD delegates to the platform’s real file picker — matching the user’s OS theme and behaviour exactly.
Supported dialog types:
| Method | Description |
|---|---|
NativeFileDialog.NFD_OpenDialog | Single-file open picker |
NativeFileDialog.NFD_OpenDialogMultiple | Multi-file open picker |
NativeFileDialog.NFD_SaveDialog | Save-file dialog with default filename |
NativeFileDialog.NFD_PickFolder | Folder/directory picker |
tinyfd
Maven artifact:org.lwjgl:lwjgl-tinyfdKey classes:
TinyFileDialogs
tinyfd (tiny file dialogs) is a native dialog library that provides file pickers, message boxes, color choosers, input prompts, and notification popups through a single, simple API. It falls back gracefully across platforms — using Zenity/kdialog on Linux, native dialogs on Windows and macOS.
Available dialogs:
| Method | Description |
|---|---|
TinyFileDialogs.tinyfd_openFileDialog | Single or multi-file open dialog |
TinyFileDialogs.tinyfd_saveFileDialog | File save dialog |
TinyFileDialogs.tinyfd_selectFolderDialog | Folder picker |
TinyFileDialogs.tinyfd_messageBox | OK / OK-Cancel / Yes-No message box |
TinyFileDialogs.tinyfd_inputBox | Single-line text input dialog |
TinyFileDialogs.tinyfd_colorChooser | Color picker dialog |
TinyFileDialogs.tinyfd_notifyPopup | System notification/toast |
| Feature | tinyfd | NFD Extended |
|---|---|---|
| File open/save dialogs | Yes | Yes |
| Folder picker | Yes | Yes |
| Message / input boxes | Yes | No |
| Color picker | Yes | No |
| Native look on all platforms | Varies (uses scripts on Linux) | Yes |
| Multi-select | Yes | Yes |
For strictly file/folder dialogs, NFD Extended provides a more consistent native appearance. Use tinyfd when you also need message boxes, input prompts, or color pickers without pulling in a larger UI library.