Hi!
I have a JTable in a JScrollPane. After a lot of research I finally managed to set the columns width for the table. But how can I change the width of the table itself?
I already tried:
But the setViewSize() methode doesn't seam to have any impact on the size of the JScrollPane at all.
I put the JScrollPane in a JPanel with GridBagLayout... might this be the problem?
I am really fishing in the dark...
Cheers
frag
patrick.metz@epost.de
I have a JTable in a JScrollPane. After a lot of research I finally managed to set the columns width for the table. But how can I change the width of the table itself?
I already tried:
Code:
ttmCorrections = new TisTableModel(vecCorrections, vecCorr_Headers);
tableCorrections = new JTable(ttmCorrections);
tableCorrections.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
setColumnWidth(new int[]{200, 200, 200, 200, 200, 200, 200, 200, 200});
scrollPane_CorrTable = new JScrollPane(tableCorrections);
scrollPane_CorrTable.getViewport().setViewSize(new Dimension(300,300));
But the setViewSize() methode doesn't seam to have any impact on the size of the JScrollPane at all.
I put the JScrollPane in a JPanel with GridBagLayout... might this be the problem?
I am really fishing in the dark...
Cheers
frag
patrick.metz@epost.de