JTree Problem

S

Sascha Fuss

Hi,

I still had a couple of Jtrees and I want to create one Jtree under one
root.

For example a model which consist of model1, model2....

Did someone knows how it works.

Hope someone knows it.

Sascha
 
Z

zero

Hi,

I still had a couple of Jtrees and I want to create one Jtree under one
root.

For example a model which consist of model1, model2....

Did someone knows how it works.

Hope someone knows it.

Sascha

Seems to me like you'll need to create a new model, and add all the
children of the other models in a loop.

You could also implement your own TreeModel, using a Collection to store
the data. Then you wouldn't need any loops, just Collection:addAll.
 
T

Thomas Weidenfeller

Sascha said:
I still had a couple of Jtrees and I want to create one Jtree under one
root.

For example a model which consist of model1, model2....

Did someone knows how it works.

Either merge (by copying) the data from the separate models into a new
tree, or just implement an own TreeModel, which wraps the original
models, and dispatches to the them.

/Thomas
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

JTree problem 2
Modify JTree look and feel 7
[SWING] Problem with JTree 2
JTree bizarreness 0
Extra Row in JTree 6
Jtree renderers 0
How to serialize/deserialize a JTree ? 1
JTree oddity... 5

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top