使用下面的代码,无法设法让列标题显示..也添加了 Jscroolpane,但没有运气......
String[] col = {"COLA","COLB","COLC"};
Object[][] data = {};
DefaultTableModel model = new DefaultTableModel(data,col);
JTable table = new JTable(model);
JScrollPane scrollPane = new JScrollPane(table);
contentPane.add(table);
table.setBounds(295, 11, 512, 411);
contentPane.add(scrollPane,BorderLayout.CENTER);