File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "JTable Column Size" Watch "JTable Column Size" New topic

JTable Column Size

Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
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.
I agree. Here's the link:
subject: JTable Column Size
jQuery in Action, 3rd edition