# Build AWT and Swing desktop applications with Quarkus Desktop

DevFeed: [Build AWT and Swing desktop applications with Quarkus Desktop](<https://devfeed.tech/articles/build-awt-and-swing-desktop-applications-with-quarkus-desktop-62158.md>)

Original publisher: [Read original article](<https://quarkus.io/blog/quarkus-desktop/>)

Author: Fouad Almalki (https://twitter.com/engineer\_fouad)

Published: 2026-09-30T00:00:00Z

Content type: tutorial

Language: en

Sources: [Quarkus - Supersonic Subatomic Java](<https://devfeed.tech/sources/quarkus-supersonic-subatomic-java.md>)

Topics: [Swing](<https://devfeed.tech/topics/swing.md>), [Quarkus](<https://devfeed.tech/topics/quarkus.md>), [Electron](<https://devfeed.tech/topics/electron.md>), [Maven](<https://devfeed.tech/topics/maven.md>)

Tags: [asynchronous](<https://devfeed.tech/tags/asynchronous.md>), [graalvm](<https://devfeed.tech/tags/graalvm.md>), [java](<https://devfeed.tech/tags/java.md>), [linux](<https://devfeed.tech/tags/linux.md>), [macos](<https://devfeed.tech/tags/macos.md>), [run](<https://devfeed.tech/tags/run.md>)

## AI overview

Quarkus Desktop lets Java teams build AWT and Swing applications as GraalVM native executables. The extension registers the platform resources these applications need, supports JVM, development, and native modes across Windows, Linux, and macOS, and integrates windows and desktop events with Quarkus CDI. The article also explains event dispatch thread rules and handling macOS application menu events.

## Source excerpt

Java has shipped AWT and Swing for decades, and many teams still build and maintain desktop applications with them. A GraalVM native executable is attractive for these applications: it starts fast, needs no JVM on the user's machine, and ships as one executable with a few libraries. But AWT and Swing are hard to compile natively. The JDK looks up classes, resources, and JNI callbacks by name, and each platform uses its own set. Quarkus Desktop is a Quarkus extension for these applications. It registers what AWT, Java2D, fonts, images, printing, the clipboard, drag and drop, input methods, sound, accessibility, and Swing need in a native executable. It also copies the JDK libraries that the executable loads next to it. The same application runs in JVM mode, in dev mode, and as a native executable on Windows, Linux, and macOS. Add the extension Add Quarkus Desktop Swing to your application: <dependency> <groupId>io.quarkiverse.desktop</groupId> <artifactId>quarkus-desktop-swing</artifactId> <version>0.1.0</version> </dependency> For an application that only uses AWT, add quarkus-desktop-awt instead. You can find the latest version on Maven Central. Open a window With Quarkus Desktop, a window is a CDI bean. It observes DesktopStartupEvent, which is fired on the event dispatch thread once the application has started: import io.quarkiverse.desktop.awt.DesktopStartupEvent; @Singleton public class MainWindow extends JFrame { @Inject Library library; @ConfigProperty(name = "app.title", defaultValue = "Library") String title; void open(@Observes DesktopStartupEvent event) { setTitle(title); setDefaultCloseOperation(DISPOSE_ON_CLOSE); add(new JScrollPane(new JList<>(library.titles()))); pack(); setVisible(true); } } The window gets @Inject and @ConfigProperty like any other bean. There is no main method and no @QuarkusMain. When the last window is closed, the application exits through Quarkus, so ShutdownEvent observers and @PreDestroy methods run. Windows are @Singleton or