Swing GUI BuilderA visual drag-and-drop GUI builder for Java Swing in VS Code. Design your Swing interfaces visually and generate clean Java source code — no manual layout math required. Features
Requirements
InstallationFrom VSIX
From MarketplaceSearch for Swing GUI Builder in the VS Code Extensions view ( Quick Start
Available Commands
ConfigurationProject Config (
|
| Setting | Type | Default | Description |
|---|---|---|---|
swingGuiBuilder.defaultBackgroundColor |
string | #FFFFFF |
Default background color for new components |
swingGuiBuilder.defaultTextColor |
string | #000000 |
Default text color for new components |
swingGuiBuilder.defaultFontFamily |
string | Arial |
Default font family for new components |
swingGuiBuilder.defaultFontSize |
number | 12 |
Default font size for new components |
swingGuiBuilder.outputDirectory |
string | swing/components/ |
Default output directory for generated Java files |
Per-component overrides are available for each supported component type (e.g. swingGuiBuilder.components.Button.defaultBackgroundColor).
Supported Components
| Component | Java Class | Description |
|---|---|---|
| Button | JButton |
Clickable button with text label |
| Label | JLabel |
Static text display |
| TextField | JTextField |
Single-line text input |
| PasswordField | JPasswordField |
Masked text input for passwords |
| TextArea | JTextArea |
Multi-line text input |
Generated Code
When you run Generate, the extension produces:
- A main JFrame class — sets up the window with absolute positioning (
nulllayout), instantiates and places all components at the coordinates you defined on the canvas. - Custom component classes — if a component has non-default styling (colors, fonts), a separate class extending the base Swing component is generated with the styling applied.
- Event listener stubs — empty listener methods are generated for interactive components so you can fill in your application logic.
All generated files are placed in the configured output directory.
Development (React + Vite Webview)
The webview UI is implemented as a React + Vite app in webview-app/ and built into out/webview/.
Install dependencies
pnpm install
Webview development workflow
Start the frontend dev server:
pnpm --dir webview-app devBuild production webview assets consumed by the extension:
pnpm --dir webview-app buildCompile extension sources:
pnpm run compile
Build and validation commands
pnpm --dir webview-app typecheck
pnpm --dir webview-app build
pnpm run compile
pnpm run lint
pnpm run package