一方面,可以在构造函数中写
JTable(Object[][] rowData,
Object[] columnNames)Constructs a JTable to display the values in the two dimensional array,
rowData, with column names, columnNames.
JTable(TableModel dm)Constructs a JTable that is initialized with
dm as the data model, a default column model,
and a default selection model.
JTable(TableModel dm,
TableColumnModel cm)Constructs a JTable that is initialized with
dm as the data model, cm
as the column model, and a default selection model.
JTable(TableModel dm,
TableColumnModel cm,
ListSelectionModel sm)Constructs a JTable that is initialized with
dm as the data model, cm as the
column model, and sm as the selection model.
JTable(Vector rowData,
Vector columnNames)Constructs a JTable to display the values in the
Vector of Vectors, rowData,
with column names, columnNames.
另一方面,如果是通过 TableModel 初始化的,可以随时更新要显示的数据的
~~~~~~