aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes How to implement getColumnClass in interface TableModel Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "How to implement getColumnClass in interface TableModel" Watch "How to implement getColumnClass in interface TableModel" New topic
Author

How to implement getColumnClass in interface TableModel

Kevin Tysen
Ranch Hand

Joined: Oct 12, 2005
Posts: 255
I'm trying to create an implementation of javax.swing.table.TableModel. I have a good idea of how to do most of the implementation, but I don't know how to implement the getColumnClass method.
Darryl Burke
Bartender

Joined: May 03, 2008
Posts: 4658
    
    5

For most requirements, it is sufficient (and easiest) to extend DefaultTableModel and override getColumnClass(...). You can find an example of overriding getColumnClass(...) in the tutorial linked from the JTable API. The example code shows a class that extends AbstractTableModel, but unless you have rather complex requirements, you won't need to do that.


luck, db
There are no new questions, but there may be new answers.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to implement getColumnClass in interface TableModel