Board index » jbuilder » How to clear a tree to draw a new one

How to clear a tree to draw a new one


2005-05-03 10:32:52 AM
jbuilder15
Hi,
I have a testprogram that get data from a JDataStore and build a tree
from that.
As the root is the CEO in the organization. I have a list of CEOs in my
database and place them in a jComboBox. I have added an actionperformed
trigger to my ComboBox so that if a new CEO is selected I want to clear
out the tree (created in jbInit) and build a new one with new data from
my DB.
I just can't find a way to empty the tree.
Any help and/or pointers to this is appreciated.
Magnus
PS. I have got most of my help so far from:
java.sun.com/docs/books/tutorial/uiswing/components/tree.html
 
 

Re:How to clear a tree to draw a new one

I got it to work
I thought I could work with the Tree but realized that I need to work
with the root node and the TreeModel.
Magnus wrote:
Quote
Hi,

I have a testprogram that get data from a JDataStore and build a tree
from that.

As the root is the CEO in the organization. I have a list of CEOs in my
database and place them in a jComboBox. I have added an actionperformed
trigger to my ComboBox so that if a new CEO is selected I want to clear
out the tree (created in jbInit) and build a new one with new data from
my DB.

I just can't find a way to empty the tree.

Any help and/or pointers to this is appreciated.

Magnus

PS. I have got most of my help so far from:
java.sun.com/docs/books/tutorial/uiswing/components/tree.html