Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JTreeTable

 
Kurt Peters
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
http://java.sun.com/products/jfc/tsc/articles/treetable1/

I'm trying to use a JTreeTable with my own model, I have hand-jammed children and root nodes that are a subclass of DefaultMutableTreeNode.

It seems that number of children is correctly returned for getChildCount, and isLeaf return true of false correctly, but the little "plus sign" icons are not showing up to allow nodes to open/close.

Does anyone have any ideas of what method I might not be overriding to get this to work properly? I've tried the examples on the web site above, and they work. When I change to 'my data' and subclass of defaultmutabletreenode, I get this weird behaviour.

Kurt
 
Kurt Peters
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I found the solution. I had not defined one of the columns to override getColumnClass to return TreeTableModel.class in the column I wanted the tree to appear.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic