I have a JTable
inside of a JScrollPane
. I want to get the columns to stay fixed when I resize it. The rows stay the same size, and there is a scrollba
Set the table's auto resize mode to "off"
table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
Take a look at JTable#setAutoResizeMode for more details.
Update
I should mention, this will mean you will become responsible for determine the size of each column.
Take a look at How to use tables and Setting and Changing Column Widths