O
Omega
This is a question for the experts (obviously).
I'm working on a small project to develop a messenger-type application.
I'm planning on using the JTree object to represent my contact list.
It seems like a very nice all-in-one expandable (in the future) object.
(I don't need alternative pre-made messenger solutions to solve all my
woes, I have to write this program myself.)
Sadly, my Swing experience is still limited - just the usual 2D
graphics demos. I don't have a lot of experience working with the more
complicated objects. JTree appears to make use of a lot of different
objects apart from itself.
Is anyone able to explain to me how to populate, modify (at run time)
and in general get really good at using the JTree object?
Specifically:
- Should I be extending JTree into an object called "ContactListUI" and
then customizing it?
- What are the best practices to add/delete leaf & branch nodes?
- Should objects from the outside be generating nodes and then push
them into the tree or should the tree just be told to make a node with
a specific title? (Encapsulation - grr!)
My idea is that I can extend JTree to become my all-in-one contact list
UI (no networking code), and have it track the association between user
names and unique user IDs...Any interactions from the user will cause
the JTree to poke & prod the appropriate control classes with the right
unique IDs.
I would LOVE for this to develop into a philosophical discussion. All
the ideas deserve to get out on the table here!
- Omega
I'm working on a small project to develop a messenger-type application.
I'm planning on using the JTree object to represent my contact list.
It seems like a very nice all-in-one expandable (in the future) object.
(I don't need alternative pre-made messenger solutions to solve all my
woes, I have to write this program myself.)
Sadly, my Swing experience is still limited - just the usual 2D
graphics demos. I don't have a lot of experience working with the more
complicated objects. JTree appears to make use of a lot of different
objects apart from itself.
Is anyone able to explain to me how to populate, modify (at run time)
and in general get really good at using the JTree object?
Specifically:
- Should I be extending JTree into an object called "ContactListUI" and
then customizing it?
- What are the best practices to add/delete leaf & branch nodes?
- Should objects from the outside be generating nodes and then push
them into the tree or should the tree just be told to make a node with
a specific title? (Encapsulation - grr!)
My idea is that I can extend JTree to become my all-in-one contact list
UI (no networking code), and have it track the association between user
names and unique user IDs...Any interactions from the user will cause
the JTree to poke & prod the appropriate control classes with the right
unique IDs.
I would LOVE for this to develop into a philosophical discussion. All
the ideas deserve to get out on the table here!
- Omega