🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.jbuilder.java.swing
2 messages
2 total messages Started by Magnus Tue, 03 May 2005 02:32
How to clear a tree to draw a new one
#412
Author: Magnus
Date: Tue, 03 May 2005 02:32
19 lines
1643 bytes
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: 
http://java.sun.com/docs/books/tutorial/uiswing/components/tree.html#create
Re: How to clear a tree to draw a new one
#414
Author: Magnus
Date: Tue, 03 May 2005 14:10
26 lines
1921 bytes
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:

> 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: 
> http://java.sun.com/docs/books/tutorial/uiswing/components/tree.html#create
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads