| Author |
Retrieving DefaultTableModel from JTable
|
Hewa Naimanage Sumedha Amalka
Greenhorn
Joined: Oct 31, 2006
Posts: 19
|
|
Hi guys, I need to get DefaultTableModel from my exsiting Jtable; I am using Java 5.0 and when I use
DefaultTableModel model = (DefaultTableModel)dataTable.getModel();
sends me a
java.lang.ClassCastException
|
SCJP 1.4 71%, SCWCD 1.5 84%, SCBCD 90%, SCMAD 98%
|
 |
Darryl Burke
Bartender
Joined: May 03, 2008
Posts: 4166
|
|
If you need the table to have a DefaultTableModel, either construct it with a DefaultTableModel or setModel to a DefaultTableModel.
If the table's model isn't a DefaultTableModel, you can't cast it as such.
|
luck, db
There are no new questions, but there may be new answers.
|
 |
 |
|
|
subject: Retrieving DefaultTableModel from JTable
|
|
|