WindowBuilder Pro, Hello World Java Swing
>> 25 January 2011
A step by step tutor with images, Hello World Java Swing application, using WindowBuilder. This tutor describe the installation and Hello World Swing application.
WindowBuilder is a powerful and easy to use bi-directional Java GUI designer. It is composed of SWT Designer, Swing Designer and GWT Designer.
WindowBuilder Pro is built as a plug-in to Eclipse.
Very easy to use with it's WYSIWYG layout, with a drag and drop capabilities.
After Google have acquired Instantiations, WindowBuilder becomes new open source project with major code contribution to Eclipse Foundation.
Thanks Google :)
Installation :
In Eclipse -> Help menu -> Install New Software
In the text field "Work with" enter the plug-in location of your Eclipse version ( Eclipse 3.6 Helios :
http://dl.google.com/eclipse/inst/d2wbpro/latest/3.6)
Click on "Add" button
Give a name of your choice to this Repository -> Click on "OK"
In "Available Software" dialog -> Select All -> Next
Install Details -> Next
Review the license -> I accept -> Finish
Installing Software
In "Security Warning" -> Click "OK" to continue
When installation finished -> Restart Now
Hello World Swing
Create a new Java Project
File menu -> New -> Java Project
Give a name to your project in "Project name" -> Finish
In "Package Explorer" -> Right click the project name -> New -> Other
In "Select a wizard" dialog -> Select WindowBuilder -> Swing Designer -> Jframe -> Next
Enter a name for the JFrame -> Finish
HelloWorldFrame.java (the name given to the JFrame class) is opened in the editor (source). To open the Swing Designer -> Click on "Design" tab
To open the Swing palette in it's own view -> Window menu -> Show View -> Other
Under WindowBuilder -> Palette
Add JLabel to the Frame
Click on JLabel component in the palette -> Drag to the Frame
Drop on the Frame. The JLabel is added
In the "Properties" dialog -> Modify the label's text -> Hello World Swing !!!
The source is modified. Notice the clean code.
Run the application
Right click on the project (in Package Explorer) -> Run As -> Java Application
Et voilà
Going further
Other modification to JFrame are easy made, like changing the Frame's title, icon, or adding any other components, or modifying the layout, etc.
Enjoy an easy and efficient design.
References :
http://code.google.com/javadevtools/wbpro/
http://code.google.com/javadevtools/download-wbpro.html
24 comments:
Wow! Thanks for the tip, it was very useful for. I didn't know this tool before your post and now I have knowledge of a powerful tool!
Thx so much!
Thanks for explaining that with screen shots.
I really liked the way tutorial is written.
http://extreme-java.blogspot.com
Thanx for the comments
Great simple "Get started" tutorial.
Thanks
Thnx for the comment :)
when do an update
An error occurred while collecting items to be installed
session context was:(profile=SDKProfile, phase=org.eclipse.equinox.internal.p2.engine.phases.Collect, operand=, action=).
Artifact not found: osgi.bundle,org.eclipse.wb.core.lib,0.9.0.r36x201105061148.
http://dl.google.com/eclipse/inst/d2wbpro/latest/3.6/plugins/org.eclipse.wb.core.lib_0.9.0.r36x201105061148.jar
Artifact not found: osgi.bundle,org.eclipse.wb.core.ui,0.9.0.r36x201105061153.
ym id/skype id: chika.tambun
cc: chika.tambun@gmail.com
use this if the latest release doesn't work
http://dl.google.com/eclipse/inst/d2wbpro/beta/3.6
Thanks for the comments.
WindowBuilder is scheduled to be part of Eclipse, very soon.
Why don't you try to take a look at the following URLs, if you want and update from Eclipse.
http://www.eclipse.org/windowbuilder/
http://www.eclipse.org/windowbuilder/download.php
it works through offline update, thankyou for leading the way
br
Thank you too
Thank you very much.
Every time I tried to create a new project, it kept using org.eclipse.swt as the source folder. I didn't like that.
Yours is the only example I could find that showed the extra step of how to create a new project correctly.
Again, thank you.
Thank you very much.
Every time I tried to create a new project it kept using "org.eclipse.swt" as the source folder. I didn't like that.
Yours was the only example, that I could find, that showed the correct way to make a new project.
Again, thank you.
Thanks for the comment
I'm really glad, that the tutor was helpful for you
Kaesar
Great tutorial, thanks!
With Eclipse 3.7/Indigo I had to change the repository to http://dl.google.com/eclipse/inst/d2wbpro/latest/3.7
When I just did that, some dependencies broke. I also had to add http://download.eclipse.org/releases/indigo After I added both and installed from the Google repository, the installation worked properly.
Thanks!
Thank you for a great tutorial! Very detailed and everything a tutorial should be!
Thank you for the comment and the very fine words
Kaesar
Thank you for making this page. Very straight forward. Does not assume that I have already done the task I am looking for like some tutorials. Will definitely link to your page.
Thank you for the comment. I'll do my best :)
Thank you for a great tutorial! Very detailed and everything a tutorial should be!
Thanks so much for the comment and your kind words :)
Thank you !!!!!!!!!!
Thanks so much for the nice comment :)
Thanks. Really good stuff
You're welcome.
Thanks for the fine words
Post a Comment