为什么我的列标识符没有显示? 你只能看到没有更多的面板。
public class ListPanel extends JTable {
private String[] titles = null;
private DefaultTableModel model = null;
public ListPanel() {
initializeControls();
this.setVisible(true);
}
public void initializeControls() {
this.titles = new String[] { "Kategorie", "Fach", "Beschreibung", "Von", "Bis", "Erledigt" };
this.model = new DefaultTableModel(titles,0); //auf eins gesetzt um zu testen
this.model.setColumnIdentifiers(this.titles);
this.setModel(model);
}
}
大型机中的代码:
private ListPanel tasktable = null;
tasktable = new ListPanel();
this.add(tasktable,BorderLayout.CENTER);