|
Java™ by example!
|
|
|
How do I set the width of a JTable column?
you should do something like this:
TableColumn column=jTable1.getColumnModel().getColumn(1); column.setMinWidth(0); column.setMaxWidth(300); column.setPreferredWidth(15);
|
Setting column.setMinWidth(0); column.setMaxWidth(300);
is not nessesary, but you'll be sure that desired width fits in this range.
Further Information
Author of answer: marcin
Comments
Comments to this answer are only viewable by members. Login or become a member!
|
|
|
|
|