• Post Reply Bookmark Topic Watch Topic
  • New Topic

JTable Disable Entire Column  RSS feed

 
meera rao
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How can we disable an entire column in a JTable?
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
isCellEditable(...)
 
meera rao
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Isn't this method used to find out if a particular cell is editable or not?
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
> Isn't this method used to find out if a particular cell is editable or not?

 
meera rao
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot for sharing the code with me. I'll try to figure out how to use it in my case.
 
Leandro Coutinho
Ranch Hand
Posts: 423
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there how to do it after instanciation?
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you can create a class field
int col = -1;

then have the code


then select the column (col) later on (runtime etc)
 
Leandro Coutinho
Ranch Hand
Posts: 423
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks for your reply.

what I trying to say is it:

JTable jt = new JTable();

...

then I add the restriction.
 
Leandro Coutinho
Ranch Hand
Posts: 423
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
don't need to worry!

it was because I'm using Netbeans and he doens't permit edit the text. But I openned with other text editor and added your solution.


thanks a lot
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!