---
tags: Java,WindowBuilder
---
# How to use WindowBuilder
## Introduce
WindowBuilder is a plugin for eclipse. It can be easy to generate java code for gui.
## Install
Download
https://www.eclipse.org/windowbuilder/download.php
Here, I download the zip file.

Open Eclipse and click
Help -> Install new Software
All ticked and keep to install.

## How to use
###### Create a Java Project
First, created a new java project named "demo" and click finish button.

###### Create a JFrame
File -> New -> Select a wizard
WindowBuilder -> Swing Designer -> JFrame

Named JFrame class "GuiDemo"

Switch to Design, it shows GUI design.

###### Set layout for JFrame
Right mouse click
Set layout -> Absolute layout

First click componets: JLabel and JButton to JFrame

Renew to name these componets.

Add Event Handler for button.

Add to change JLable string when button is clicked.

Finally, Run it!
