Start

Building the frontend

Use plain HTML or any frontend framework with Jolt: dev server with hot reload while you work, files from the jar for release.

Your page is normal HTML, CSS and JavaScript. The web view is Chromium (WebView2) on Windows and WebKit (WebKitGTK) on Linux, so write for both.

Development

Point the window at your dev server and let it do hot reload:

window.setSecurity(window.security().withTrustedOrigins("http://localhost:5173"));
window.loadUrl("http://localhost:5173");

Or serve a folder from disk. Files are re-read on every request:

window.loadResources(AppResources.directory(Path.of("ui")));

Release

Put the built page in src/main/resources/ui and serve it from the jar:

window.loadResources(AppResources.classpath("ui"));

Separate HTML, CSS and JS files work, as do relative URLs and ES modules. The origin is stable, so localStorage survives restarts. A single self-contained HTML file (Vite with vite-plugin-singlefile) can use loadHtml instead.

Any framework

React, Vue, Svelte and htmx all work, because to Jolt the page is just a page. A small typed wrapper around jolt.postMessage (for example a call<T>(method, params) function with one function per Java handler) keeps the rest of the frontend free of the bridge. Parsel is a complete app built this way: a Vue page for the interface, with Java behind it for IMAP and SMTP.

Developer tools

WindowOptions.defaults().withDevTools(true), then right-click and choose Inspect, or call window.openDevTools().