This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Java Interview Guide and have Anthony DePalma on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes checkbox in JTable Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "checkbox in JTable" Watch "checkbox in JTable" New topic

checkbox in JTable

selvas kumars
Ranch Hand

Joined: Jan 06, 2001
Posts: 115
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 ??
Deepal Mehta

Joined: May 28, 2001
Posts: 6
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?
I agree. Here's the link:
subject: checkbox in JTable
It's not a secret anymore!