Home - fakeivchenko/lwjwae GitHub Wiki
lwjwae is a Java library that shows a web page in a native window. You write the interface in HTML, CSS, and JavaScript, and the logic in Java. The window uses the web engine that the operating system already has, so the application stays small and starts fast.
In this tutorial, you build a small notes application step by step. By the end, the application saves notes in Java, shows them on the page, draws its own title bar, exports notes through a native file dialog, keeps running in the system tray, and shows a notification when an export is done. Then you give it an icon and a name, build it as a native executable, and package it for Linux, Windows, and macOS with the lwjwae Gradle plugin.

Tutorial
Each page adds one feature to the notes application and ends with a link to the next one.
- Set up the project
- Open a window
- Call Java from the page
- Send events from Java to the page
- Draw your own title bar
- Export notes through a native dialog
- Keep the application in the tray
- Show notifications
- Give the application an icon and a name
- Build a native executable
- Package the application
Guides
Each guide shows one feature beyond the tutorial, with a small application that you can run.
- Pass objects through the bridge: records and other objects in bindings and events, through a codec.
- Stream bytes between the page and Java: calls that carry bytes, answers that stream, and cancelling them.
- Open several windows: windows from Java and from pages, messages between them, and child and modal windows.
- Place and control a window: size, place, full screen, on top, the screens, and a window that remembers where it was.
- Make a transparent window: a widget of any shape over the desktop.
- Add menus: a menu bar, a context menu, and menus that the page opens.
- Register global shortcuts: keys that reach the application from any other one.
- Show progress in the taskbar: a bar and a count on the icon of the application.
- Use the clipboard: text and images, from Java and from the page.
- Handle dropped files: the paths of files that land on a window.
- Zoom the page: from Java, with one call.
- Set the window icon: from the parameters, and from Java at any time.
- Follow the theme of the desktop: light and dark, in Java and on the page.
- Use cookies: sign a user in from Java, and read what the page sees.
- Store data in SQLite: a database in one file, from Java and from the page.
- Keep secrets: tokens and passwords in the credential store of the system.
- Show dialogs: files and folders to open, and questions.
- Run a single instance: a second start that hands its files to the first.
- Open your own links and files: a scheme such as
notes://and the types of files that the application opens. - Update the application: signed releases that the application finds, downloads, and installs.
- Handle page permissions: the camera and the microphone, denied until Java says yes.
- Handle links and page loads: where links go, what Java sees of the page, and a development server with hot reload.
Reference
- Gradle plugin: what the plugin does, the short form of a build script, the page built with npm, the packages, signing, and the tasks.
- Gradle plugin configuration: every setting of the
lwjwae {}block, with its default. - README: the whole API, the modules, and the requirements of each platform.
- Releases: the versions and what changed in each.
- lwjwae-codecs: the JSON codecs for typed bindings and events.