Ralph Cook wrote:I could extend TableColumn so that it had a "most specific superclass" stored for it; however, DefaultTableColumnModel stores its list of columns as a Vector<TableColumn>, so I can't store subclasses of TableColumn there (if you aren't familiar with generics, take my word for it or look it up).
luck, db
There are no new questions, but there may be new answers.
Ralph Cook wrote:My first thought was that TableColumn would have somewhere to store this column class, but it does not.
SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
Rob Spoor wrote:You usually create a sub class of AbstractTableModel or DefaultTableModel to return something more specific than Object.class; I often use a switch statement.
javadoc wrote:A TableColumn represents all the attributes of a column in a JTable, such as width, resizibility, minimum and maximum width. In addition, the TableColumn provides slots for a renderer and an editor that can be used to display and edit the values in this column.
javadoc wrote:Defines the requirements for a table column model object suitable for use with JTable.
Ralph Cook wrote:
Rob Spoor wrote:You usually create a sub class of AbstractTableModel or DefaultTableModel to return something more specific than Object.class; I often use a switch statement.
Well, yes I can do that, but it seems like such a kludge.
I have trouble understanding the conceptual model around JTable, possibly because no one documents conceptual models any more.
SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
Consider Paul's rocket mass heater. |