Modern Windows 10/11 window decorations and dark mode for Java applications.
FastTheme brings native Windows styling to Swing and AWT. It enables dark mode title bars, Mica/Acrylic effects, and custom window decorations by bridging Java with the DWM (Desktop Window Manager) API.
// Quick Start β Enabling Premium Overlay Mode
import fasttheme.FastTheme;
import javax.swing.JFrame;
public class Demo {
public static void main(String[] args) {
JFrame frame = new JFrame();
frame.setSize(600, 96);
// Remove all Java window decorations (title bar, borders)
// Required for creating a true overlay-style window
frame.setUndecorated(true);
// Center the window on the screen
frame.setLocationRelativeTo(null);
// Set the window background to pure black
// Since the title bar is removed, the content area becomes the visible body
frame.getContentPane().setBackground(new Color(0, 0, 0));
// The native HWND is created only after the window becomes visible
frame.setVisible(true);
long hwnd = FastTheme.getWindowHandle(frame);
if (hwnd != 0) {
// Enables the Windows 11 shadow (DWM + WS_THICKFRAME)
FastTheme.setBorderlessShadow(hwnd, true);
// Defines the height of the invisible drag zone at the top
// Allows the window to be dragged like Raycast/Spotlight
FastTheme.setOverlayDragHeight(hwnd, 6);
// Applies semi-transparency to the entire window (0β255)
FastTheme.setWindowTransparency(hwnd, 230);
} else {
System.err.println("β HWND is 0 β native window handle not found!");
}
}
}- Key Features
- Quick Start
- Installation
- Try the Demo
- API Reference
- Documentation
- Platform Support
- License
- Related Projects
- π Native Dark Mode β Proper title bar and border coloring.
- β¨ Glass Effects β Support for Mica and Acrylic effects (Win 11).
- πͺ Premium Overlays β Borderless windows with native shadows and custom drag zones.
- π Zero Lag β Direct DWM attribute manipulation via native calls.
FastJava modules require two dependencies: the module itself, and FastCore (which handles the native library extraction).
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>com.github.andrestubbe</groupId>
<artifactId>FastTheme</artifactId>
<version>0.1.2</version>
</dependency>
<dependency>
<groupId>com.github.andrestubbe</groupId>
<artifactId>fastcore</artifactId>
<version>0.1.0</version>
</dependency>
</dependencies>repositories {
maven { url 'https://jitpack.io' }
}
dependencies {
implementation 'com.github.andrestubbe:FastTheme:0.1.2'
implementation 'com.github.andrestubbe:fastcore:0.1.0'
}Download the latest JARs directly to add them to your classpath:
- π¦ fasttheme-0.1.2.jar (The Core Library)
- βοΈ fastcore-v0.1.0.jar (The Mandatory Native Loader)
Important
Both JARs must be in your classpath for the native JNI calls to function correctly.
Want to see the high-performance transition engine in action?
- Clone this repository:
git clone https://github.com/andrestubbe/FastTheme.git - Run the premium showcase:
.\run-demo2.bat
Note: The demo showcases the v0.1.2 Borderless Shadow and Drag-Zone logic.
| Method | Description |
|---|---|
long getConsoleWindowHandle() |
Retrieves the native Win32 HWND window handle of the active console. |
void setBorderlessShadow(long hwnd, boolean enable) |
Enables borderless mode with native shadows (Raycast-style). |
void setOverlayDragHeight(long hwnd, int pixels) |
Sets the height of the invisible drag zone. |
void setTitleBarDarkMode(long hwnd, boolean enable) |
Toggles the native system dark mode for the title bar. |
void setWindowTransparency(long hwnd, int alpha) |
Sets native window transparency (0-255). |
void setTitleBarColor(long hwnd, int r, int g, int b) |
Sets a custom native title bar background color. |
- REFERENCE.md: Exhaustive catalog of
FastThemenative methods, DWM constants, HWND extraction, and JNI contracts. - PHILOSOPHY.md: Zero-allocation Win32 DWM bridge architecture, layered attributes, and flicker-free window subclassing.
- ROADMAP.md: Planned milestone features and OS theme integration.
- CHANGELOG.md: Version history and release notes.
- COMPILE.md: Native C++ JNI build instructions and Maven deployment.
| Platform | Status |
|---|---|
| Windows 10 (1903+) | β Dark Mode |
| Windows 11 | β Dark Mode, Mica, Acrylic |
MIT License β See LICENSE file for details.
- FastCore β Native Library Loader
- FastAnimation β High-precision animation engine
- FastTween β SIMD-optimized interpolation
Made with β‘ by Andre Stubbe