Java WindowBuilder installation and basic use
Posted May 26, 2020 • 2 min read
Check before installation
First find [About Ecplise]
Then click installation detail
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.
To install WindowBuilder, you need to find [help]-[Ecplise MarketPlace]in Ecplise.
After opening, enter windowBuilder in the position shown
The plug-in shown below will appear, click install
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
Select the created project as shown in the figure below, you should select the [SWT/JFace]project
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
Under normal circumstances, we all create [JFrame]files, as shown below
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
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.
After completing the design, do you want to execute the program or execute it through the normal [Run]
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
Need to delete all the libraries in the red frame
After deleting, you can see a most basic interface appears