arrays - Exception in thread "AWT-EventQueue-0" java.lang.ClassCastException: javax.swing.JTable$1 cannot be cast to javax.swing.table.DefaultTableModel -
when trying copy table data array, run time exception got. , used
defaulttablemodel model = new defaulttablemodel(datavalues, columnnames); jtable.setmodel(model);
i used setmodel
method of table set model. still problem exists. please provide me sample code.
the default type of values stored in table of object type. try converting first "string" type (or required), , storing in array.