OK, I want to get all the data from the first JTable column. I, although the best way could have pulled him in ArrayList, so I made one. I also made an instance TableModel:
static DefaultTableModel model = new javax.swing.table.DefaultTableModel();
f.data.setModel(model);
public static final void CalculateTotal(){
ArrayList<String> numdata = new ArrayList<String>();
for(int count = 1; count <= model.getRowCount(); count++){
numdata.add(model.getValueAt(count, 1).toString());
}
System.out.println(numdata);
}
This gives me a NullPointerException (scream scream) exception. What am I doing wrong?
source
share