This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
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


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
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: 1121

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: 1121

Thanks for the help ;-)
Discovered method shouldSelectCell in interface javax.swing.CellEditor.
Problem resolved!
 
wood burning stoves
 
subject: JTable column editable but not selectable
 
Similar Threads
How to color JTable cell without a renderer?
Checkbox editor for JTable column
JTable
JCheckBox in JTable
Could not be able to perform Action on JTable Cell --> Components