如何将JTable中的数据一下子清空
1个回答
2017-01-05
展开全部
DefaultTableModel tableModel = new DefaultTableModel();// (DefaultTableModel)scoreTable.createDefaultDataModel();
String[] columns = {"一", "二", "三", "四"};
Object[][] data = {
{"", "", "", ""},
};
tableModel.setDataVector(data, columns);
scoreTable.setModel(tableModel);
String[] columns = {"一", "二", "三", "四"};
Object[][] data = {
{"", "", "", ""},
};
tableModel.setDataVector(data, columns);
scoreTable.setModel(tableModel);
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询