r/javaswing

Quarkus Desktop is out! Build AWT/Swing apps with CDI, Dev Mode, and hassle-free GraalVM Native Executables 🚀
â–˛ 22 r/javaswing+1 crossposts

Quarkus Desktop is out! Build AWT/Swing apps with CDI, Dev Mode, and hassle-free GraalVM Native Executables 🚀

Hey everyone,

PS: Two days ago I was looking to add some "Web API" capabilities into a Java Swing based Point of Sales and a found this extension (quarkus-desktop). u/quarkus

For decades, AWT and Swing have been the backbone of many powerful desktop applications. However, modernizing them—especially trying to compile them into GraalVM native executables—has always been a painful journey. Managing reflection, JNI callbacks, and OS-specific resources by hand for GraalVM is incredibly tedious.

That is why the Quarkus community just launched Quarkus Desktop!

It is a brand new official Quarkiverse extension designed to bring the absolute best of modern Java development (CDI, live reload/dev mode, centralized configuration) straight into AWT and Swing desktop apps.

🌟 Key Features:

  • True Native Executables: It completely automates the heavy lifting for GraalVM. It registers all necessary reflection, fonts, images, drag-and-drop, and clipboards for Windows, Linux, and macOS.
  • **Windows & Window Management:**No more public static void main. Windows are treated as standard CDI beans (@Singleton or @Dependent) that observe a DesktopStartupEvent fired automatically on the Event Dispatch Thread (EDT).
  • Thread Safety Made Easy: Swing requires everything to run on the EDT. Quarkus Desktop introduces an injected EdtExecutor (works great with CompletableFuture or Mutiny) and a @RunOnEdt annotation to automatically offload background work and return safely to the UI thread.
  • Native OS Integrations: Seamlessly handles macOS application menus (About, Preferences, Quit requests) by firing them as standard CDI events.
  • Rock Solid Stability: The extension is backed by a massive showcase app containing 75 pages and ~3,800 automated checks compared pixel-by-pixel between JVM and Native modes across all operating systems.

đź’» Quick Code Preview:

import io.quarkiverse.desktop.awt.DesktopStartupEvent;

import jakarta.inject.Singleton;

import javax.swing.*;

@ Singleton

public class MainWindow extends JFrame {

@ Inject

MyBackendService service;

void open(@Observes DesktopStartupEvent event) {

setTitle("Quarkus Powered Swing App");

setDefaultCloseOperation(DISPOSE_ON_CLOSE);

add(new JScrollPane(new JList<>(service.getData())));

pack();

setVisible(true);

}

}

đź”— Official Links to check it out:

What do you think about this approach? Could this help you breathe new life into older enterprise Swing systems or build lightweight native utilities?

u/poolborges — 14 days ago