Hi All,
I am experiencing a weird problem while compiling a program related to JTable.
I am overriding getValueAt( int , int ) of AbstractTableModel class. Here is the implemnattion of the method:
public
Object getValueAt(int nRow, int nCol) {
if (nRow < 0 | | nRow >= getRowCount())
return "";
StockData row = (StockData)m_vector.elementAt(nRow);
switch (nCol) {
case 0: return row.m_symbol;
case 1: return row.m_name;
case 2: return row.m_price;
}
return " ";
}
Every time I compile the program I am getting the following compilation error:
The method Object getValueAt(int, int) declared in class StockTableData cannot override the method of the same signature declared in class javax.swing.table.AbstractTableModel. They must have the same return type.
public Object getValueAt(int nRow, int nCol) { And the strange thing is that I am able to compile and run this program successfully on the other machine.
I have copied this program from the text book and trying to learn JTable concepts.
Regards,
Milind
[This message has been edited by Milind Kulkarni (edited August 14, 2000).]