Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

checkbox in JTable

 
selvas kumars
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI folks,
Any idea of having only checkboxes in a column.The checkboxes must be grouped in the table, so only one will be selected at any time.My requirement will be something like i will be adding a row dynamically,so the checkbox should also fall in that group??How it can be acheived ??
Regards,
silva.
 
Deepal Mehta
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello
For getting checkboxes within your table make the first column as new Boolean(true or false) as per the requirement. This will incorporate the checkboxes within the JTable. Now to make the checkbox true is possible but once you keep it inside a group only one checkbox at a time will be true. for that a coding is required inside the mouse click event.
How have you generated rows dynamically within the JTable?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic