Witam mam problem z przekazaniem nowych wartości do zmiennych poprzez edycje komórek jTable. Nie wiem gdzie robię błąd starałem się postępować według wskazówek z dokumentacji swing. Proszę o małą pomoc oto mój model
public class Model extends AbstractTableModel
{
Double a=0.0;
Double b=0.0;
Double c=0.0;
Double d=0.0;
private String[] columnNames = {"a","b","c","d"};
private Double[][] data = { {a,b,c,d} };
@Override
public int getColumnCount() {
return columnNames.length;
}
@Override
public int getRowCount() {
return data.length;
}
@Override
public String getColumnName(int col) {
return columnNames[col];
}
@Override
public Object getValueAt(int row, int col) {
return data[row][col];
}
@Override
public Class getColumnClass(int c) {
return getValueAt(0, c).getClass();
}
@Override
public boolean isCellEditable(int row, int col) { return true;}
@Override
public void setValueAt(Object value, int row, int col)
{
data[row][col] = (Double) value;
fireTableCellUpdated(row, col);
fireTableDataChanged();
}
public void wypisz()
{
System.out.println(a);
System.out.println(b);
System.out.println(c);
System.out.println(d);
}
}
public class Tablica extends javax.swing.JFrame {
Model model;
public Tablica()
{
initComponents();
model = new Model();
jTable1.setModel(model);
}