swingx
  1. swingx
  2. SWINGX-1521

JTable, BooleanEditor: inconsistent background color

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.6.4
    • Fix Version/s: 1.6.5
    • Component/s: Renderer
    • Labels:
      None

      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?

        Activity

        Hide
        kleopatra added a comment -

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

        committed in revision #4231

        Show
        kleopatra added a comment - fixed by adjusting selected (to take into account shouldSelect) before passing to super committed in revision #4231

          People

          • Assignee:
            kleopatra
            Reporter:
            kleopatra
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: