JavaFX Support
July 10, 2026 ยท View on GitHub
A VS Code extension for JavaFX development with FXML support.
Features
- ๐จ FXML Syntax Highlighting - Full syntax highlighting for
.fxmlfiles - ๐๏ธ FXML Language Mode - To open
.fxmlfile in Scene Builder, select 'Open in Scene Builder' from the context menu - ๐ง Scene Builder Integration - Configure Scene Builder path and open FXML files directly in Scene Builder
- ๐ Formatter - You can use an XML formatter specifically designed for FXML
- โ๏ธ Linked Editing - Renaming an opening FXML tag also updates the matching closing tag
- ๐จ FXML Diagnostics - Surface missing controller classes and duplicate
fx:idvalues directly in the Problems panel - ๐ก FXML Quick Fixes - Use the lightbulb on missing
fx:idfields and missingonActionhandlers to generate matching@FXMLcontroller members - ๐ FXML โ Controller & Resource Navigation - Ctrl+Click on
fx:controller,onAction,fx:id,@image.png, or@style.cssin FXML to jump to the corresponding controller code or referenced resource file - ๐ Controller โ FXML Navigation - Ctrl+Click on
@FXMLannotated variables or methods in the Controller class to jump to the corresponding location in the FXML file - ๐ Find All References - Press
Shift+F12on an FXMLfx:idto find$fxIdusages in the current FXML file together with the matching controller field declaration - ๐ Workspace Symbols - Press
Ctrl+T/Cmd+Tto searchfx:idvalues and matching@FXMLfield names across the workspace - ๐ก FXML Hover - Optionally show controller field and event handler comments on hover
- ๐จ JavaFX CSS IntelliSense - Get
-fx-property completions, enum-like value suggestions, and hover details inside.cssfiles and FXMLstyleattributes, plusstyleClassnavigation/references/completion across workspace CSS files - ๐ Internationalization - English, Chinese, Japanese language support
Usage
FXML Syntax Highlighting
Open any .fxml file and it will automatically use the FXML language mode with syntax highlighting.
Open in Scene Builder
- Open an
.fxmlfile in VS Code - Right-click in the editor or file explorer
- Select "Open in Scene Builder"
FXML Formatting
- Open an
.fxmlfile - Use
Shift+Alt+F(or your configured format shortcut) to format the document
Linked Editing
- Rename an opening tag such as
<Label>and VS Code will keep the matching closing tag</Label>in sync while you type - Linked editing is enabled by default for FXML files
Code Navigation
FXML โ Controller:
- Ctrl+Click on
fx:controller="com.example.MyController"to open the controller class - Ctrl+Click on
fx:id="myButton"to jump to the@FXMLannotated field - Ctrl+Click on
onAction="#handleClick"to jump to the@FXMLannotated method - Ctrl+Click on
image="@images/logo.png"orstylesheets="@styles/main.css"to open the referenced resource file relative to the current FXML file - Ctrl+Click on
styleClass="primary-button"to jump to matching.primary-buttonselectors in workspace CSS files - Press
Shift+F12onfx:id="myButton"to list$myButtonusages in the current FXML document and the matching controller field declaration
Controller โ FXML:
- Ctrl+Click on an
@FXMLannotated field to jump to thefx:idin the FXML file - Ctrl+Click on an
@FXMLannotated method to jump to the event handler in the FXML file
CSS โ FXML:
- Press
Shift+F12on a CSS selector such as.primary-buttonto list matchingstyleClassusages in workspace FXML files
Workspace Symbol Search
- Press
Ctrl+T(Windows/Linux) orCmd+T(macOS) - Search for an FXML
fx:idor a matching Java@FXMLfield name to jump to it from anywhere in the workspace
FXML Hover
- Hovering
fx:controller="com.example.MyController"shows the matching controller class comment - Hovering
fx:id="myButton"shows the matching controller field comment, including inherited members - Hovering
onAction="#handleClick"shows the matching controller method comment, including inherited members - Hover is disabled by default and can be enabled with a configurable delay
FXML Diagnostics
- Missing
fx:controllerclasses are reported as errors fx:idvalues without matching controller fields are reported as warnings- Missing controller event handlers such as
#handleClickare reported as errors - Duplicate
fx:idvalues in the same FXML file are reported as errors
FXML Quick Fixes
- Use
Ctrl+./Cmd+.on a missingfx:idwarning to generate@FXML private <Type> <fxId>;in the controller - Use
Ctrl+./Cmd+.on a missingonActionhandler error to generate@FXML private void <handler>(ActionEvent event) {}in the controller
JavaFX CSS IntelliSense
- Type
-fx-in a.cssfile or an FXMLstyleattribute to see JavaFX-specific CSS properties such as-fx-background-color,-fx-font-size, and-fx-text-fill - Type inside an FXML
styleClass=""attribute to complete CSS class names discovered from workspace.cssfiles - After properties such as
-fx-alignment:, completion suggests common enum-like values such asCENTERandTOP_LEFT - Selecting a JavaFX CSS value inserts one space after
:and appends; - Hover a JavaFX CSS property to see its syntax, default value, and where it applies
Configuration
| Setting | Description | Default |
|---|---|---|
tlcsdm.javafxSupport.sceneBuilderPath | Path to Scene Builder executable | "" (auto-detect) |
tlcsdm.javafxSupport.hover.enabled | Enable FXML hover information for controller comments referenced by fx:controller, fx:id, and event handlers | false |
tlcsdm.javafxSupport.outline.showFxId | Show fx:id details in the FXML Outline view | true |
tlcsdm.javafxSupport.outline.showText | Show text details in the FXML Outline view | true |
tlcsdm.javafxSupport.hover.delay | Delay in milliseconds before showing FXML hover information | 300 |
Installation
From VS Code Marketplace
- Open VS Code
- Go to Extensions (Ctrl+Shift+X)
- Search for "Tlcsdm JavaFX Support"
- Click Install
From VSIX File
- Download the latest
.vsixfile from Releases - Open VS Code
- Go to Extensions (Ctrl+Shift+X)
- Click the
...menu and select "Install from VSIX..." - Select the downloaded
.vsixfile
From Jenkins
Download from Jenkins
Development
Prerequisites
- Node.js 22.x or later
- npm
Build
# Install dependencies
npm install
# Compile
npm run compile
# Watch mode (for development)
npm run watch
# Lint
npm run lint
# Note: with TypeScript 7.x, lint temporarily checks JS tooling files with ESLint. `src/` TypeScript files are type-checked (not fully linted) via `tsc --noEmit` until typescript-eslint adds TS7 support.
# Test
npm run test
# Package extension
npx @vscode/vsce package
License
MIT License - see LICENSE for details.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.