A VS Code extension for JavaFX development with FXML support.
- 🎨 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
Open any .fxml file and it will automatically use the FXML language mode with syntax highlighting.
- Open an
.fxmlfile in VS Code - Right-click in the editor or file explorer
- Select "Open in Scene Builder"
- Open an
.fxmlfile - Use
Shift+Alt+F(or your configured format shortcut) to format the document
- 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
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
- 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
- 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
- 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
- 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
- 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
| 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 |
- Open VS Code
- Go to Extensions (Ctrl+Shift+X)
- Search for "Tlcsdm JavaFX Support"
- Click Install
- 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
Download from Jenkins
- Node.js 22.x or later
- npm
# Install dependencies
npm install
# Compile
npm run compile
# Watch mode (for development)
npm run watch
# Lint
npm run lint
# Test
npm run test
# Package extension
npx @vscode/vsce packageMIT License - see LICENSE for details.
Contributions are welcome! Please feel free to submit a Pull Request.