This class extends AbstractTableModel
. It has an ArrayList arr but I don't know how to use the fire methods.
public void adiciona(Entidad e) {
if(DEBUG)
System.out.println( " tamaño: "+tamaño()+" columas: "+getColumnCount()+"" + Arrays.deepToString(columnNames) ); //size 6
arr.add(e);//adds
if(DEBUG)
System.out.println( " tamaño: "+tamaño()+" columas: "+getColumnCount()+"" + Arrays.deepToString(columnNames) ); //size 7
//setNumRows( getRowCount() - 1 );
//System.out.println( "hola");
fireTableStructureChanged();//BOOOOm EXEPTION NULL POINTER ARRAY
fireTableDataChanged();
System.out.println( "hola");
}
i am checking the java source on how java has the default table model ... what would be the equivalent for
private void justifyRows(int from, int to) {
arr.setSize(getRowCount());
for (int i = from; i < to; i++) {
if (dataVector.elementAt(i) == null) {
dataVector.setElementAt(new Vector(), i);
}
((Vector)dataVector.elementAt(i)).setSize(getColumnCount());
}
}
in an ArrayList