Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

implementing custom TreeSelectionModel

843807Jan 19 2010 — edited Jan 23 2010
I am a very green Java Developer. And need help getting started on writing a class that implements the TreeSelectionModel Interface.

Here's the background to the issue:
I am working on a JTree that uses check boxes for the nodes.

I have it mostly working however the only way to select more than one node is to use ctrl/shift +click.

I have looked at the source code DefaultTreeSelectionModel, and it appears to be little more than an overly complex hashing system to DefaultListSelectionModel. Which would be fine if my tree structure didn't represent a list of items that were on/off. So It is of my opinion that DefaultTreeSelectionModel is simply not well suited for a tree of checkboxes.

Anyways, I'm slowly dissecting the source code but it's rather intimidating, and I was hoping that someone has done this before and provide some pointers.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 20 2010
Added on Jan 19 2010
5 comments
226 views