jtable更新数据

时间:2021-02-12 21:06:04
  static JTable table;

    public void refrushTableData() {

        String[] columnNames = { "", "", "" };
String[][] tableData = { { "", "", "" },
{ "", "", "" }, { "sept", "siete", "sette" } }; DefaultTableModel dtm = new DefaultTableModel(tableData, columnNames);
table.setModel(dtm);
// dtmView.fireTableDataChanged();
dtm.fireTableStructureChanged();
}

另有一篇写的比较好的  http://www.cnblogs.com/langtianya/archive/2012/12/07/2807153.html