File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Swing / AWT / SWT and the fly likes JTreeTable problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JTreeTable problem" Watch "JTreeTable problem" New topic
Author

JTreeTable problem

Tom Hughes
Ranch Hand

Joined: Feb 09, 2002
Posts: 86
Hi,
I'm trying to use the JTreeTable component found on the java.sun website, with little success.
I have written my own customised TreeTableModel that uses DefaultMutableTreeNodes to store my tree structure. When I use this model in a JTree it works, in a JTreeTable, it doesn't - only the top two levels of my tree are displayed and they are not displayed in a tree structure (it just looks like a plain table).
I really don't know what I'm doing wrong, and it's driving me crazy. If anyone could help, it would be greatly appreciated.
This is the model that I am using (if you need the JTreeTable stuff then ask and I'll post it too)

thanks very much,
Tom
Tom Hughes
Ranch Hand

Joined: Feb 09, 2002
Posts: 86
Hi,
Fixed my own problem, it was a bugger to find (took me at least a day). The solution was to override the getColumnClass method in AbstractTreeTableModel with the following,
 
Consider Paul's rocket mass heater.
 
subject: JTreeTable problem
 
Similar Threads
JTreeTable Expansion problems
JTable In JTree
Freezing first column(JTree) in JTreeTable - Urgent Please
JTree
JTree