P
Peter
Hi
I have an exception of the line "return content.size();" in
getRowCount(), it said the vector content is null. But if i extends
the AbstractTableModel rather than DefaultTableModel, no exception,
please tell me why?
thanks
from Peter
public class MyTableModel extends DefaultTableModel {
String columnNames[] = {"1", "2", "3", "4", "5"};
Vector content=new Vector();
public MyTableModel() {
}
public int getColumnCount() {
return columnNames.length;
}
public String getColumnName(int col) {
return columnNames[col];
}
public Object getValueAt(int row, int column) {
"Peter"
}
public int getRowCount() {
return content.size();
}
}
I have an exception of the line "return content.size();" in
getRowCount(), it said the vector content is null. But if i extends
the AbstractTableModel rather than DefaultTableModel, no exception,
please tell me why?
thanks
from Peter
public class MyTableModel extends DefaultTableModel {
String columnNames[] = {"1", "2", "3", "4", "5"};
Vector content=new Vector();
public MyTableModel() {
}
public int getColumnCount() {
return columnNames.length;
}
public String getColumnName(int col) {
return columnNames[col];
}
public Object getValueAt(int row, int column) {
"Peter"
}
public int getRowCount() {
return content.size();
}
}