Hallo erstmals,
ich habe eine JTable mit 29 Spalten. Ich füge diese in ein JScrollPane und möchte nun (damit überhaupt etwas lesbar ist), dass das JScrollPane auch horizontal scrollt, sobald es notwendig ist.
Vertikal funktioniert alles.
Hinter der Tabelle hat es ein Tablemodell.
hier ein Beispiel:
hat jemand eine Idee?
Gruss Reto
ich habe eine JTable mit 29 Spalten. Ich füge diese in ein JScrollPane und möchte nun (damit überhaupt etwas lesbar ist), dass das JScrollPane auch horizontal scrollt, sobald es notwendig ist.
Vertikal funktioniert alles.
Hinter der Tabelle hat es ein Tablemodell.
hier ein Beispiel:
Code:
JTable jTable = new JTable(tableModel);
jTable.setVisible(true);
jTable.setAutoscrolls(true);
jTable.setAutoResizeMode(2);
jTable.setAutoCreateColumnsFromModel(true);
this.jContentPane.add(new JScrollPane(new JScrollPane(jTable),
JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS),
BorderLayout.CENTER);
hat jemand eine Idee?
Gruss Reto