I’m waiting for more stuff to install but while that is happening I may as well share some more. I doi a lot of Java programming lately, some for the net but more for desktop use. So that means graphical layouts, writing all the code to make a user interface. Well a user interface has 3 components, the layout, that is the menus, the titlebar, buttons, widgets, dialogs, dialogs and more dialogs. And then the code run by the users interaction with those widgets, the things that happen when you click a menu item or a button in a dialog or if the user right clicks the middle of the editor window. These are the things that make a gui work and gives the user the ability to actively use the program. And the third part of the program the actual data, data structures and files that the user is creating.
In Java one of the tools I use to create applications was the Visual Editor, which was a project of the Eclipse foundation. That particular editor is not seeing much action as far as updates and the like but in it’s place Google has donated the Window Builder Pro Gui Designer. Just like the box says it is a graphical editor for the gui parts of your application. You can put these into their own classes to build the gui away from the other parts of your code or for small apps put the code all in one or a few files. Dialogs could be seperate from the main which could be seperate from your actions which would be seperate from your parser and writer classes. If what you are making is some type of file editor for instance.
It can read in your existing java apps and give you a graphical editor to use to edit them in as well, not just making editing current projects easier but also editing any Gui Java projects you are maintaining.
Adding WindowBuilder to Eclipse is easily done by adding the update site to your eclipse and then selecting the packages and installing them. Once installed creating a new gui class is done by using one of the new WindowBuilder new class wizards. Then drag the parts of the GUI you want into the space in the design window. Three basic types are available, Swing which is the normal java widget toolkit that allows atn application to look the same on any platform, or SWT and Eclipse project widget set that uses the native widgets for the OS being run on so that applications look like the rest of the applications on that OS. (THis doesn’t end cross platform compatibility, rather you write one app and on Windows has the Windows widgets, but when you run it on Linux, with no rewriting of code it looks like a Linux application, and apparently it also works on Mac and Android and on QNX without changing the code.
The third type is the Google Web Toolkit for making nice looking Web Applications.
So there you go, if you have been making java GUI interfaces with any of these toolkits and up until now you have been doing this by writing code, and I know I have, there is a visual editor that you can use and it will make life a lot easier. Yes you can still do things by hand to finish your layouts exactly but do the initial layout of the with a tool and it make the job a lot faster.
- WindowBuilder becomes new open source project with major code contribution to Eclipse Foundation (googlecode.blogspot.com)