update your tablemodel.
JTable.setValueAt

解决方案 »

  1.   

    JTable.setValueAt(Object value, int nRow, int nCol);value指的是什么?
    如果(0,0)原来是1,我现在把它该成6,当我点击保存按纽时,怎么把6取出来?
      

  2.   

    //button is your 保存按纽;
    button.addActionListener(new ActionListener(){
            public void actionPerformed(ActionEvent e){
    int row=table.getSelectedRow();
    int col=table.getSelectedColumn();
    table.getCellEditor(row,col).stopCellEditing();
    //以下两行测试 Model 已经改变
             Object o=table.getValueAt(row,col);
    System.out.println(o);  }
    });