aspose file tools*
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 Java 8 in Action this week in the Java 8 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!
 
Consider Paul's rocket mass heater.
 
subject: JTable column editable but not selectable
 
Similar Threads
Could not be able to perform Action on JTable Cell --> Components
JTable
Checkbox editor for JTable column
JCheckBox in JTable
How to color JTable cell without a renderer?