resize columns in JTable

  • Thread starter Daniel Luis dos Santos
  • Start date
D

Daniel Luis dos Santos

Hello,

I have a JTable on which I set a model derived from AbstractTableModel.
I then want to put a fixed size on the first column.
When I get the column model from the table or from the tableheader it is empty.

How do I synchronize the column model to the table model ?
How do I set the size attributes of a table column ?
 
J

John B. Matthews

Daniel Luis dos Santos said:
Hello,

I have a JTable on which I set a model derived from
AbstractTableModel. I then want to put a fixed size on the first
column. When I get the column model from the table or from the
tableheader it is empty.

How do I synchronize the column model to the table model ?
How do I set the size attributes of a table column ?

TableHeader? I think you want the TableColumnModel returned by
getColumnModel(), as shown here:

<http://java.sun.com/docs/books/tutorial/uiswing/components/table.html#wi
dth>

If that's not it, you might try posting an <http://sscce.org/>.
 
R

Roedy Green

I have a JTable on which I set a model derived from AbstractTableModel.
I then want to put a fixed size on the first column.
When I get the column model from the table or from the tableheader it is empty.

How do I synchronize the column model to the table model ?
How do I set the size attributes of a table column ?

Have a look at the code for Vercheck. I put lower and upper bounds on
each column that the user can adjust within.

See http://mindprod.com/products1.html#VERCHECK
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top