If yous're an amateur Coffee developer, like I am, you probably know that creating the simplest of GUI driven applications tin can be challenging. While reading for the last year of my degree, a yr or so ago, I came across WindowBuilder which, in short, takes the hurting out of edifice a graphical interface for Java applications. If yous're an Eclipse IDE user, read on.

Adding WindowBuilder to Eclipse

I currently have Eclipse Neon.three Release four.half-dozen.3 installed on my habitation PC. The procedure outlined should nevertheless work on older and later on releases of Eclipse.

From the Help menu, select Install New Software

Type http://download.eclipse.org/windowbuilder/WB/integration/4.6/ in the Piece of work With field, bank check the box next to WindowBuilder and hit the Next push.

Review the items that will be installed and hit Next. I opted to install all the items listed but you tin always choice and cull what to install.

Accept the license agreement and hit Finish.

After the installation completes, you volition exist asked to restart Eclipse.

To exam WindowsBuilder, create or open an existing Project. From the default package, select Other from the New menu or simply press CTRL-n. Scrolling downward to the end of the Wizards list, you should see an entry named WindowBuilder.

As an case, I want to create an application that uses Swing so I merely expand Swing Designer and select Application Window from the listing of available options. Click Next.

Type in a name for the new Swing awarding and click Finish.

The sorcerer creates all the required base code for y'all. If you run information technology, an empty JFrame window is displayed.

To add together elements or components to the JFrame, switch to the Design folio by clicking the tab at the bottom of the code page. In one case you're in that location, you can change the layout, add together containers, issue handlers and what not. Although all the required code is automatically added for you, you still demand to add logic to it to make it all work. And then for instance, if you desire to add together a record to a database past clicking on an Add button, yous volition add together the required logic to an event handler. To  practice this simply, right-click on a component, a JButton in this case, and select an upshot handler.

Here'south a more thorough example of what WindowBuilder tin can practice for y'all. This is a screenshot of an application I wrote as part of my studies.

So, at present you know what tool to apply when developing an UI driven Coffee app! To learn more than about WindowBuilder, visit the official documentation site here.

Thank you!