aspose file tools*
The moose likes Beginning Java and the fly likes JTable Column Size Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "JTable Column Size" Watch "JTable Column Size" New topic
Author

JTable Column Size

Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
Hi,
I am creating an application, that displays a JTable and
a JTextField among other things. A user can select a column
and then type in a size for that column.
I know that my code is getting the correct size. However the column never displays itself correctly. EX: A column with a
size of 20 characters does not display 20 characters.
I am using AbstractTableModel, and a TableColumn to handle
everything. The amount of code that I have is to large to
include in a message, but I will anyone the code if they wish.
I am using setAutoResizeMode(JTable.AUTO_RESIZE_OFF) so
that I can handle that column sizes manually.
Any suggestions would be helpful.
Fernando
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: JTable Column Size