• Post Reply Bookmark Topic Watch Topic
  • New Topic

Jtable column

 
ramesh kancherla
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a jTable in my frame.i am displaying icons in one column,and chcekbox in another column( new Boolean(FALSE) ).

i want to change only checkbox column in to Boolean(TRUE).

how can i change it.
where can i make changes.
 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by ramesh kancherla:

i want to change only checkbox column in to Boolean(TRUE).


The table model holds the data for the table. That is the logical place to make data changes.
Read this for details.
 
Rob Spoor
Sheriff
Posts: 20820
68
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You want to change it through code? If so, you can use the setValue method in either the table or the table's model. The difference between the two is that the table's column indexes can be different from the model's column indexes.

Also, please use Boolean.FALSE, Boolean.TRUE and/or Boolean.valueOf(boolean) instead of new Boolean. That will decrease the number of objects created; since there are only two boolean values, these constants will be all that is needed. valueOf will return one of these two.
 
ramesh kancherla
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!