Use Drag Drop Feature for Designing Java Applications in Eclipse with Window Builder
Mostly everyone in computer programming is familiar with Eclipse. It is an Integrated Development Environment used to develop applications mostly in Java.
If you want to use eclipse to design java swing components just by dragging and dropping then here is a tutorial for you.
This is not swing but it is almost same as swing. This is SWT (Standard Widget Toolkit) developed for eclipse.
If you want to use drag drop feature for designing java applications in eclipse then there is a plugin name WindowBuilder. You need to install this plugin in your eclipse.
ADVANTAGES OF USING SWT INSTEAD OF SWING
- uses native elements when possible, so always native behavior
- supported by eclipse, gui editor VEP (VEP also supports Swing and AWT)
- large number of examples online
- has an integrated awt/swt bridge to allow use of awt and swing components
- looks very good
- Download Eclipse from the Links Given Below
- Unzip the downloaded file and save it anywhere in your hard drive
- Now you can open Eclipse from the folder.
INSTALLING WINDOW BUILDER PLUGIN IN ECLIPSE
- Download Window Builder from the links given below
- Now Open Eclipse (I am using Eclipse Kepler)
- Go to Help -> Install New Software
- Click on Add then Click Archive in the Dialog Box that will appear and then select the .zip file which you have download above.
- Now you will see three names in the list Swing Designer, SWT Designer and WindowBuilder Engine, Select all and click on finish.
- Now you will ask to accept the license accept it as you always do 😛
- Now click on Install and the Window Builder will start installing
- You must be connected with internet or else it will show you an error because it downloads some plugins while installing (it will download about 50-60mbs)
- Wait for a while and the WindowBuilder will be installed
USING DRAG AND DROP FOR SWING COMPONENTS OF JAVA IN ECLIPSE
- Create a New Project, Go To New -> Project
- Select WindowBuilder -> SWT Designer -> SWT/JFace Java Project
- Give Name to your project and click on finish.
- On Package Explorer right click on your project and go to New -> Other
- Select WindowBuilder -> SWT Designer -> SWT -> Composite and then Click Next
- Give any name in the Name Field and click on Finish
- Now you will see the source code window, just below the source window click on design
- Now you will see a layout like this
- And you are done. Use your eclipse to design Java Applications same as you do in NetBeans.
- Don’t forget to share the post if you find this helpful. 🙂