Using JTree bean

Hi,
When i am placing a JTree bean in the form.
The default format for the JTree bean displayed.
Default format means…
elements in the JTree are
(DEFAULT)
Colors:-blue…violet…red…yellow
Sports:-baset ball…socker…footbal…hockey
Foods:-hotdogs…pizza…ravioli…bananas

How can we change these elements i.e Colors, Sports, Foods.
Can i insert elements of our own.
Can we add or remove a path or an elment from the total path.
please help.[/img]

Hi,

You can’t do much with only a JTree object unless you are coding pure Java.
Use the DBTreeView bean instead. That is specially designed to work with Servoy.

Hope this helps.

For the Java part (if you are familiar with that), see How to Use Trees (The Java™ Tutorials > Creating a GUI With Swing > Using Swing Components)

Hi,
I have tried using the DBTree.
From the forum, i came to know that
Every click on a node can fire a method.
But How?

How Can i assign a method to a node.
so that when a user click on a node an event get fired.
How?

elements.bean.setCallBackInfo() is your friend

Thanks,
Ok, I am trying.

here, when i am adding a relation, to the DBTree view.
it shows the values in the hierarchy.
But, the related values are taking the names of the parent node.
that is… the name displayed in the parent node is same as the name displayed in the child(related) node.

Can i change the name displayed in the tree hierarchy?
both in the Root node as well as in the parent node?

Have you checked out the example solution that displays the workings of the DBTreeView bean that comes with a freshly installed Servoy environment?

Paul