Java Programming - JExcelAPi Help. VERY URGENT!!!

Hi Guys,

I'm currently working on a project which involves using the JExcelApi. I imported the content of an excel file into a jtable successfully but the problem is:

The user needs to select a row in the table which is to be deleted on the click of a button, this action displays an error, below is some of my code and the error displayed

DefaultTableModel model = (DefaultTableModel) xlsTable.getModel();

System.out.println(model.getRowCount());

model.removeRow(xlsTable.getSelectedRow());

THIS IS THE EXCEPTION THROWN

Exception in thread "AWT-EventQueue-0" java.lang.ClassCastException: com.medic.client.importExcel$SheetTableModel cannot be cast to javax.swing.table.DefaultTableModel

[821 byte] By [Shegmana] at [2007-11-26 23:23:32]
# 1

you that everybody needs help!

you're not the only one ...

why is it so urgent?

the error is:

SheetTableModel cannot be cast to DefaultTableModel !

so what is a SheetTableModel? and ask it in the swing forum

Message was edited by:

supareno

suparenoa at 2007-7-10 14:29:26 > top of Java-index,Java Essentials,Java Programming...
# 2
Did the people who wrote that code tell you their getModel() method returned something compatible with DefaultTableModel? If so then it's their fault. Bug them about it. If not then you can't do that.And you need to work on your time management skills.
DrClapa at 2007-7-10 14:29:26 > top of Java-index,Java Essentials,Java Programming...