Java WindowBuilder installation and basic use

Posted May 26, 20202 min read

Check before installation

First find [About Ecplise]
image.png
Then click installation detail
image.png
If WindowBuilder and related plug-ins are found in the [install Software]tab, it means that the plug-in has been installed in Ecplise. If it is already installed, you can skip the installation part.
image.png

Install WindowBuilder

To install WindowBuilder, you need to find [help]-[Ecplise MarketPlace]in Ecplise.
image.png
After opening, enter windowBuilder in the position shown
image.png ,
The plug-in shown below will appear, click install
image.png
Due to network reasons, the installation time is generally longer and you need to be patient

Basic use of windowBuilder

After the installation is complete, use [File]-[New]-[Project]to create a project
image.png
Select the created project as shown in the figure below, you should select the [SWT/JFace]project
image.png
After the new project is completed, select the [src]folder and create a java file. The java file created here cannot directly create a class, but you should select [Other]in the location shown
image.png
Under normal circumstances, we all create [JFrame]files, as shown below
image.png
After the creation is complete, we can see the interface shown in the following figure. The difference between the JFrame interface and the ordinary java file is that it can not only edit the source code, but also directly design the interface. Click [design]to design the interface
image.png
After clicking [design], we can enter the design interface as shown in the figure below, and can complete the interface design by dragging and dropping. The icon shown in the figure below is the preview button, you can immediately see the effect after the design, but this function cannot replace the normal execution operation, only the preview.
image.png

After completing the design, do you want to execute the program or execute it through the normal [Run]
image.png
At this time, it may happen that no interface appears after clicking [Run]. This is caused by a problem with the referenced library. Need to select the item, right click, select [Configure Build Path]in the position shown
image.png
Need to delete all the libraries in the red frame
image.png
After deleting, you can see a most basic interface appears
image.png