Rafael procure o tutorial na pagina da sun.
 
To customize initial column widths, you can invoke
    setPreferredWidth on each of your table's columns. This sets both
    the preferred widths of the columns and their approximate relative
    widths. For example, adding the following code to SimpleTableDemo
    makes its third column bigger than the other columns:
 
        TableColumn column = null;
        for (int i = 0; i < 5; i++) {
            column = table.getColumnModel().getColumn(i);
            if (i == 2) {
                column.setPreferredWidth(100); //sport column is bigger
            } else {
                column.setPreferredWidth(50);
            }
        }
 

        Note:  The setPreferredWidth method was first
        introduced in Swing 1.1 Beta 2. For previous releases, you
        must use setMinWidth instead, making sure to invoke it on
        every column. (Otherwise, the columns you miss will be very
        thin.)
 
Att. Claiton
-----Original Message-----
From: Rafael Frantz <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED] <[EMAIL PROTECTED]>
Date: Terça-feira, 8 de Fevereiro de 2000 09:10
Subject: Largura da coluna no JTable

Pessoal,
 
    criei uma JTable com 3 colunas, o problema que estou enfrentando e o seguinte: nao consigo que as colunas ocupem toda a area disponivel da tabela, ou seja, as tres colunas juntas ocupam somente uns 70% da area disponivel da minha tabela e quando eu "clico" sobre elas para as redimensionar, entao elas se dividem e passam a ocpar a area todal da tabela. Eu gostaria que ja no momento de criacao da tabela elas estivessem utilizando toda a area util da mesma. E ainda, como posso dizer que uma coluna pode ocupar x porcento do espaco disponivel na tabela. Isso para que eu possa dosar a largura de cada coluna de acordo com o tipo de dado?
 
 
Muito obrigado a todos!
Rafael.
 

Responder a