resize columns in JTable

Discussion in 'Java' started by Daniel Luis dos Santos, Jan 5, 2010.

  1. 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 ?
     
    Daniel Luis dos Santos, Jan 5, 2010
    #1
    1. Advertisements

  2. 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/>.
     
    John B. Matthews, Jan 6, 2010
    #2
    1. Advertisements

  3. Daniel Luis dos Santos

    Roedy Green Guest

    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
     
    Roedy Green, Jan 6, 2010
    #3
  4. Daniel Luis dos Santos, Jan 8, 2010
    #4
    1. Advertisements

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 (here). After that, you can post your question and our members will help you out.