• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

check box in the JTable

 
anand narasimha
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is the method called when the JCheckbox is selected in the JTable having a TableModel?
In my case i am able to uncheck the checkbox and not able check the checkbox
[ January 30, 2007: Message edited by: anand raghavendra ]
 
Mathias Nilsson
Ranch Hand
Posts: 367
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think you need to do this in the renderer because the state
of the checkbox is not preserved.

Try extending the DefaultTableCellRenderer class and implement the getTableCellRendererComponent method and create your own renderer.

// MAthias
 
Brian Cole
Author
Ranch Hand
Posts: 908
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by anand raghavendra:
In my case i am able to uncheck the checkbox and not able check the checkbox


Does your table model return true in isCellEditable() for the cells in question?

If so, the next thing to check is that setValueAt() handles Boolean values correctly for those cells.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic