Allowing the User to Resize a Column in a JTable Component

By default, a table allows the user to size its columns. This example demonstrates how to disable this feature.
int rows = 3; int cols = 3; JTable table = new JTable(rows, cols); table.getTableHeader().setResizingAllowed(false);

Post a comment

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Enter the characters shown in the image. Ignore spaces and be careful about upper and lower case.