Skip to main content

creating jTree from objects

1 reply [Last post]
Joined: 2010-05-09

hi all! i am new in swing and i have a question...

i have for example vector of car objects.
lets say that car include the fields: model, company year.

i would like to create a jTree that each node of his root represent a car.

that the sub-root will be the car's model and his sub-nodes are leafs that each of them is the car's company and car's year.

i know that i need to use somehow the jTree model and the cell renderer but how?

i want to be able to add new cars to the jTree how i do it?

thanks a lot!!! i hope you can help me

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Joined: 2007-04-17

See the [url=]tutorial (link)[/url].