Create a new tree

Swing Designer allows you to quickly create the frames, panels, dialogs, applets and other UI elements that comprise Java Swing applications.

Moderators: Konstantin.Scheglov, gnebling, Alexander.Mitin, jwren, Eric Clayberg

Create a new tree

Postby Reinhard » Wed Apr 19, 2006 11:49 pm

Hi,

I have installed WindowBuilder 4.3.0 on Eclipse 3.1.2.
These are my first steps in Java and I will make a decision between Swing and SWT for me.

I have created some GUIs with WindowBuilder in SWT. Here I can create a new "Tree" and drop on the tree "Tree Columns" and "Tree Items". This make the development of a test tree very fast :)

Now I would do the same with WindowBuilder in Swing. I have created a "JTree" and I don't find some "JTree Columns" or "JTree Items". Must I create the tree in Swing by hand?

Thanks for your tips,
Reinhard
Reinhard
 
Posts: 1
Joined: Wed Apr 19, 2006 11:43 pm

Re: Create a new tree

Postby Eric Clayberg » Thu Apr 20, 2006 2:02 pm

Reinhard wrote:Now I would do the same with WindowBuilder in Swing. I have created a "JTree" and I don't find some "JTree Columns" or "JTree Items". Must I create the tree in Swing by hand?

Yes. Swing does not have the equivalent of the SWT TreeColumns and TreeItems.

In Swing, you need to create a subclass of TreeModel and and then assign it to the JTree using the setModel() method.
Eric Clayberg
Software Engineering Manager
Google
http://code.google.com/webtoolkit/download.html

Author: "Eclipse Plug-ins"
http://www.qualityeclipse.com
Eric Clayberg
Moderator
 
Posts: 4503
Joined: Tue Sep 30, 2003 6:39 am
Location: Boston, MA USA


Return to Swing Designer

Who is online

Users browsing this forum: No registered users and 1 guest