This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

using Jtree in Jbuilder 8  RSS feed

 
BJon Jo
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I was trying to add a JTree component to a applet using JBuilder8.
Its pretty simple to add a JTree.
But what is really stumping me is how I customize the nodes and change them to show my requirments.
i.e: JBuilder automatically puts main nodes like Color , food etc
and subnodes like Violet Blue green etc.
So would anyone have any Idea asto how the Color, Food ... descriptions can be changed to meet my applets requirment?
Thank you
 
Bhagya Tangutur
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
it's not Jbuilder which creates tree like that.It's the behaviour of JTree.
if u want to create your nodes.
if tree is pretty simple.
u can use DefaultTreeModel and add DefaultMutableTreeNode objects to it,which refers to u r object model.
or else ...
u can subclass DefaultMutableTreeNode class and create CustomTreeNode class.and add it to defaultMutable tree node.
 
BJon Jo
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thank you very much for ur advice. i will try to follow your advice
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!