You have to override the method isCellEditable of the model that you
use... So all cell will be uneditable and your jTable will be too.
Here an example of how to do this I'm using the default table model.

      this.selectionTable.setModel (new DefaultTableModel() {
        public boolean isCellEditable(int rowIndex, int columnIndex) {
          return false;
        }
      });



        Tayanna

"... Para ganhar um Ano Novo que mereca este nome, voce meu caro, tem de
merece-lo, tem de faze-lo novo, eu sei que nao e facil, mas tente,
experimente, consciente. E dentro de voce que o Ano Novo cochila e espera
desde sempre. "
                        Carlos Drummond de Andrade

On Sun, 24 Feb 2002, D. Michael Nelson wrote:

> 
> Hello,
> 
> How would I set a JTable instance table not be editable.  I have only two
> columns in the table, and I would like to data not be modifield via the
> user.  Thanks in advance.
> 
> Take It Easy,
> M
> 
> _______________________________________________
> Swing mailing list
> [EMAIL PROTECTED]
> http://eos.dk/mailman/listinfo/swing
> 

_______________________________________________
Swing mailing list
[EMAIL PROTECTED]
http://eos.dk/mailman/listinfo/swing

Reply via email to