Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JTree not desplaying and check boxes

 
peter hammond
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hey all

thought i would give JTrees ago as i have no idea how to use them correctly..

in this project i am using netbeans and created a jTree but i wanted to add in check box's aswell but not come across this before have look over examples and tut's for 2 days now and not sure what way to go now...

i gave up on the IDE JTree and went with a scrollpane and cellrender but it doesn't display in the scrollpane??



then i was going to add in this to get the checkboxes in there..


any guides or guidence will be great many thanks......

i did try the treemodel but cant get checkboxes in it...

 
Paul Clapham
Sheriff
Posts: 21107
32
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here's something I found after a bit of googling: CheckBox Node Tree Sample.

It's a lot more complex than your attempt, but on the other hand it's possible it is too complex. We don't know anything about the age of that page; some things used to be hard to do back in 2002 but are easier now. This might be one of those things but as I said, I don't know.

If you only need the checkboxes to be read-only (you didn't mention whether you do or not) then you could leave out the CellEditor part.
 
peter hammond
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
cool thanks will give it a look over... i just want to be able select the checkbox then read what was selected...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic