A retained-mode UI framework for the FastJava ecosystem, focusing on per-component baked layers, zero-allocation rendering, and hardware-locked performance.
FastUI is a next-generation UI framework built from the ground up for maximum speed and zero-copy efficiency. Unlike traditional Java UI frameworks (Swing/AWT) that rasterize vector graphics on every frame, FastUI uses a Retained-Mode Baking Pipeline to achieve multi-thousand FPS performance on modern hardware.
- Key Features
- Why FastUI?
- Quick Start
- Performance
- Installation
- Try the Demo
- API Reference
- Platform Support
- License
- Related Projects
- 🚀 Baked Layers — Components render once into
BufferedImagecaches. - ⚡ Zero Allocation — No objects are created during the rendering of a frame.
- 🎨 DPI-Aware — Integrated with
FastDisplayfor pixel-perfect scaling. - 🧱 Pure Java Core — A lightweight, decoupled codebase with no mandatory native dependencies.
- 🔧 Deterministisch — Predictable performance and hardware-locked timing.
Standard Java UI frameworks (AWT/Swing) were designed in an era of static interfaces and slow refresh rates. In today's world of high-DPI displays, 144Hz+ monitors, and AI-driven automation, the "Immediate-Mode" rasterization model has become a bottleneck.
FastUI was built to bridge this gap by treating UI components as Persistent Graphical Assets. By shifting the workload from CPU-heavy rasterization to GPU-friendly memory blitting, we unlock a level of fluidity previously unreachable in the JVM.
- 🔴 High Rasterization Overhead — Rasterizing shapes and text every frame is CPU intensive. FastUI bakes components into offscreen buffers.
- 📉 Garbage Collector Pressure — Traditional loops allocate thousands of objects. FastUI's render path is allocation-free.
- 🌊 Resizing Flicker — Standard resizing is jittery. FastUI integrates with
FastWindowfor butter-smooth window scaling. - ⏱️ Lack of VSync Alignment — FastUI is natively synchronized to the display refresh rate via
FastDWM.
// Initialize the UI Root
FastContainer root = new FastContainer();
// Add a High-Performance Button
FastButton btn = new FastButton("Initialize Engine");
btn.setBounds(50, 50, 200, 50);
root.add(btn);
// In your VSync-locked render loop (e.g. using FastDWM)
root.render(g2d); FastUI is designed to saturate high-refresh-rate monitors (144Hz+) with minimal CPU footprint.
| Metric | FastUI | Standard Swing | Improvement |
|---|---|---|---|
| Render Time (100 Buttons) | < 0.1 ms | ~4.5 ms | 45x Faster |
| Memory Allocations | 0 per frame | ~120 KB per frame | Infinite |
| Jitter during Resize | Zero (Sync'd) | High | Liquid Smooth |
Add the JitPack repository and the dependency to your pom.xml:
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>io.github.andrestubbe</groupId>
<artifactId>fastui</artifactId>
<version>v0.1.0</version>
</dependency>
</dependencies>Add the JitPack repository to your build.gradle:
repositories {
maven { url 'https://jitpack.io' }
}
dependencies {
implementation 'io.github.andrestubbe:fastui:v0.1.0'
}For simple projects, you can download the standalone JAR directly:
- 📦 fastui-v0.1.0.jar (The Core Library)
Note
Since FastUI core is pure Java, no additional native loader (FastCore) is strictly required unless you are using the native integration features provided in the examples.
- Clone this repository.
- Run the provided batch file from the root:
.\run-demo.batNote: The demo is located in the examples/ directory and demonstrates the library's integration with FastWindow and FastTheme.
| Component | Description |
|---|---|
FastComponent |
Base class for all widgets with baking logic. |
FastContainer |
Logical grouping for absolute-positioned children. |
FastButton |
Reference widget with Normal, Hover, and Pressed states. |
FastShapeFactory |
DPI-aware shape generator for borders and backgrounds. |
FastUI is a pure Java library and is natively compatible with any platform supporting Java 17+.
| Platform | Status |
|---|---|
| Windows 10/11 | ✅ Fully Supported |
| Linux | ✅ Fully Supported |
| macOS | ✅ Fully Supported |
MIT License — See LICENSE file for details.
- FastCore — Native Library Loader for Java
- FastWindow — Native Window Engine
- FastDisplay — Real-time DPI monitoring
- FastTheme — Advanced UI styling engine
Part of the FastJava Ecosystem — Making the JVM faster.