Daniel: JTable Header

Beitrag lesen

Hallo zusammen

Ich habe versucht eine JTable in mein JFrame zu integrieren. Leider werden die Spaltenköpfe nicht angezeigt. Warum??

public void initTable() {

Container contentPane = this.getContentPane();

String[][] data = {
  {"Test","Test","Test","Test"},
  {"Test","Test","Test","Test"},
  {"Test","Test","Test","Test"},
  {"Test","Test","Test","Test"},
  {"Test","Test","Test","Test"},
  };

String[] col = {"Test1","Test2","Test2","Test3"};

JTable jTable1 = new JTable(data, col);

contentPane.add(new JScrollPane(jTable1),"Center");

jTable1.setBounds(450,80,200,200);
        contentPane.add(jTable1);
 }

Gruss Daniel