Edit your FXML and CSSFX โ see changes instantly.
No compilation, no waiting. Just save and watch.
- Open any
.fxmlfile - Hot-reload FXML โ save โ reloads instantly
- Hot-reload CSSFX โ save โ styles update without reloading the scene
- Switch between FXML files โ dropdown lists all views in your project
- Responsive viewport presets โ Phone (375ร667), Tablet (768ร1024), Desktop, HD, Custom
- Auto-reload toggle โ one click to pause/resume watching
- Error overlay โ shows load errors with a clear red banner
# Open a specific FXML
java -jar javafx-live-preview.jar /path/to/login.fxml
# Or just pick one from the file chooser
java -jar javafx-live-preview.jarRequires JDK 17 or newer. JavaFX is bundled in the JAR.
| Platform | |
|---|---|
| Windows | |
| macOS (Apple Silicon) | |
| macOS (Intel) | |
| Linux (Debian/Ubuntu) | |
| Linux (Fedora/RHEL) | |
| Linux (any distro) |
Pick your favorite way to install:
Option A: One-liner (PowerShell)
irm https://github.com/SourisCG/JavaVisualizer/releases/latest/download/JavaFXLivePreview-windows-x64.exe | iexOption B: Download & double-click
Option A: One-liner (Terminal)
curl -L https://github.com/SourisCG/JavaVisualizer/releases/latest/download/JavaFXLivePreview-macos-arm64.dmg -o ~/Downloads/JavaFXLivePreview.dmg && open ~/Downloads/JavaFXLivePreview.dmgOption B: Download & drag
- Download the .dmg (Apple Silicon) or .dmg (Intel)
- Open it and drag to Applications
- First launch: Right-click the app โ Open โ Click "Open" (this is normal for unsigned apps, you only need to do this once)
Option A: One-liner
curl -L https://github.com/SourisCG/JavaVisualizer/releases/latest/download/JavaFXLivePreview-linux-amd64.deb -o /tmp/javafx.deb && sudo apt install -y /tmp/javafx.debOption B: Download & install
- Download the .deb file
- Double-click it or run
sudo apt install ./JavaFXLivePreview-linux-amd64.deb
Option A: One-liner
curl -L https://github.com/SourisCG/JavaVisualizer/releases/latest/download/JavaFXLivePreview-linux-x86_64.rpm -o /tmp/javafx.rpm && sudo dnf install -y /tmp/javafx.rpmOption B: Download & install
- Download the .rpm file
- Run
sudo dnf install ./JavaFXLivePreview-linux-x86_64.rpm
One-liner:
curl -L https://github.com/SourisCG/JavaVisualizer/releases/latest/download/JavaFXLivePreview-linux-x64.tar.gz | tar xz && ./JavaFXLivePreview/bin/javafx-live-previewOr download & extract:
- Download the .tar.gz
- Extract it
- Run
./JavaFXLivePreview/bin/javafx-live-preview
Notes:
- All Linux packages automatically install Java 17+ if needed
- macOS users: The "app is damaged" warning is normal for unsigned apps. Just right-click โ Open once.
- Windows: No admin rights required
git clone https://github.com/SourisCG/JavaVisualizer.git
cd JavaVisualizer
./gradlew shadowJar
# Output: build/libs/javafx-live-preview.jarโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ [Open...] [login.fxml โผ] [Auto โ] [ Native โผ ] โ OK โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ โ
โ Your JavaFX scene โ
โ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
- Open... โ browse for an FXML file (or pass it as CLI argument)
- FXML selector โ switch between all
.fxmlfiles in the project - Auto toggle โ enable/disable hot-reload
- Viewport โ simulate different screen sizes
- Status โ green dot = OK, red = error
Works with any JavaFX project structure:
| Type | Detected by |
|---|---|
| Maven | pom.xml in root |
| Gradle | build.gradle in root |
| Plain Java | src/ directory |
The app auto-discovers:
- All
.fxmlfiles in the project - All
.cssfiles (applied to the scene) - Classpath (
target/classes,build/classes,bin) for controllers
User saves file โโโบ Polling watcher (every 500ms)
โ
โโโโโโโโโโโดโโโโโโโโโโ
โผ โผ
.fxml changed .css changed
โ โ
FXMLLoader.load() scene.getStylesheets().setAll()
โ โ
setRoot() applyCss() + requestLayout()
โ โ
โโโโโโโโโโโฌโโโโโโโโโโ
โผ
JavaFX renders
- No compilation โ only reloads FXML and CSS
- No WebSocket / agent โ it's a single JavaFX app
- No inotify โ uses polling (works everywhere)
# Fat JAR (any OS)
./gradlew shadowJar
# RPM (Fedora/RHEL)
./packaging/linux/build-rpm.sh
# macOS DMG (generates .icns automatically)
./packaging/macos/build-dmg.sh
# Windows MSI + EXE (requires WIX Toolset + ImageMagick for .ico)
powershell -File packaging/windows/build-exe.ps1See packaging/ for detailed instructions per platform.
MIT โ do whatever you want with it.
Made with โ in JavaFX