setValueAt
public void setValueAt(Object aValue,
int row,
int column)Sets the value for the cell in the table model at row and column.
Note: The column is specified in the table view's display order, and not in the TableModel's column order. This is an important distinction because as the user rearranges the columns in the table, the column at a given index in the view will change. Meanwhile the user's actions never affect the model's column ordering. aValue is the new value.
Parameters:
aValue - the new value
row - the row of the cell to be changed
column - the column of the cell to be changed
See Also:
getValueAt(int, int)
public void setValueAt(Object aValue,
int row,
int column)Sets the value for the cell in the table model at row and column.
Note: The column is specified in the table view's display order, and not in the TableModel's column order. This is an important distinction because as the user rearranges the columns in the table, the column at a given index in the view will change. Meanwhile the user's actions never affect the model's column ordering. aValue is the new value.
Parameters:
aValue - the new value
row - the row of the cell to be changed
column - the column of the cell to be changed
See Also:
getValueAt(int, int)
String oo;
oo = "asdfsd";
JTable.setValueAt(oo, 1, 2);
这样写提示错误。这是为什么?
---------
JTable 表示什么,类名?还是实例名称?
这样都不合适,如果是实例名称,就用了关键字!是类名,就错误。
oo = "asdfsd";
JTable.setValueAt(oo, 1, 2);
应该这样。