| Author |
How do you make a JTree using Forte for Java?
|
Sonny Pondrom
Ranch Hand
Joined: Jun 05, 2001
Posts: 128
|
|
|
Has anyone seen a tutorial showing how to make a JTree? It is easy enough to make a JFrame, add a JScollPane and then drop a JTree into it. But that only gets you a default tree. I would like to see how to use customized TreeNode and TreeModel classes.
|
 |
Guoqiao Sun
Ranch Hand
Joined: Jul 18, 2001
Posts: 317
|
|
Hi, Sonny: There is a good sample about JTree with the JDk distribution. Suppose you installed JDK at %JAVA_HOME%, the mentioned sample locates at %JAVA_HOME%\demo\jfc\SampleTree, run it with java -jar SampleTree.jar And you can get what you want. Regards,
Originally posted by Sonny Pondrom: Has anyone seen a tutorial showing how to make a JTree? It is easy enough to make a JFrame, add a JScollPane and then drop a JTree into it. But that only gets you a default tree. I would like to see how to use customized TreeNode and TreeModel classes.
------------------ Guoqiao Sun Sun Certified Programmer for Java 2 Platform try my mock exam¹²³ at my homepage.
|
Guoqiao Sun<br />SCJP2 SCWCD2<br />Creator of <a href="http://www.jiris.com/" target="_blank" rel="nofollow">www.jiris.com</a>, Java resource, mock exam, forum
|
 |
Sonny Pondrom
Ranch Hand
Joined: Jun 05, 2001
Posts: 128
|
|
Thanks Guoqiao, I found out that in the Forte IDE, if you change the "model" property in the Component Inspector to the name of your customized TreeModel, it will initialize the JTree properly.
|
 |
 |
|
|
subject: How do you make a JTree using Forte for Java?
|
|
|