[SWINGX-1521] JTable, BooleanEditor: inconsistent background color Created: 11/Aug/12  Updated: 13/Aug/12  Resolved: 13/Aug/12

Status: Resolved
Project: swingx
Component/s: Renderer
Affects Version/s: 1.6.4
Fix Version/s: 1.6.5

Type: Bug Priority: Major
Reporter: kleopatra Assignee: kleopatra
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Tags: BooleanRenderer, JXTable

 Description   

the background color is different when starting edit on a formerly unselected vs. selected row.

It's a core issue: in getXXEditorComponent, DefaultCellEditor with a JCheckBox as editing component queries the renderer for the same cell with the same parameters. At that time, the isSelected is false for an unselected row because the selection is updated after installing the editor (done in BasicTableUI adjustSelection)

Easiest option to fix would be to modify the isSelected param before calling super. Might be hard-coded true/false or query shouldSelect.

Usability issue: not-selecting the editor when the row is selected (and the other way round) is a stronger visual clue that editing is happening. Or make it configurable somehow?



 Comments   
Comment by kleopatra [ 13/Aug/12 ]

fixed by adjusting selected (to take into account shouldSelect) before passing to super

committed in revision #4231

Generated at Wed Jan 18 08:57:49 UTC 2017 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.