wood burning stoves 2.0*
The moose likes Swing / AWT / SWT and the fly likes JTable column editable but not selectable Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JTable column editable but not selectable" Watch "JTable column editable but not selectable" New topic
Author

JTable column editable but not selectable

Avi Abrami
Ranch Hand

Joined: Oct 11, 2000
Posts: 1132

Greetings,
Below is some sample code that creates a JTable with a column of checkboxes and a column of strings.
When I click on one of the checkboxes, not only does its value toggle, the entire row is selected.
What I would like is to only toggle the value and not select the row.
However, if I click on the string column, I would like the row to be selected.
I have not discovered how to achieve this and would be very grateful if someone could show me.

Thanks,
Avi.

Avi Abrami
Ranch Hand

Joined: Oct 11, 2000
Posts: 1132

Thanks for the help ;-)
Discovered method shouldSelectCell in interface javax.swing.CellEditor.
Problem resolved!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JTable column editable but not selectable