Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6882917

Nimbus and DefaultTableCellRenderer: must start with normal background

XMLWordPrintable

    • b77
    • x86
    • windows_vista

        FULL PRODUCT VERSION :
        java version "1.6.0_14"
        Java(TM) SE Runtime Environment (build 1.6.0_14-b08)
        Java HotSpot(TM) Client VM (build 14.0-b16, mixed mode, sharing)


        A DESCRIPTION OF THE PROBLEM :

        in all uis/components/OS supporting I have seen so for, the first row has normal background color and the second has the alternate color. With zero-based index counting that is alternate color in every odd row. Nimbus/DefaultTableCellRenderer do it the wrong way round: start with alternate in first row and use normal for second. Reason is that it calculates the "second" row as being the even ... which is ... ehem ... wrong in zero based counting. For consolation - we at SwingX had it incorrect in early versions as well <g>

          Fix is easy: in DefaultTableCellRenderer and SynthTableCellRenderer replace

        if row % 2 == 0

        with

        if row % 2 != 0


        REPRODUCIBILITY :
        This bug can be reproduced always.

        CUSTOMER SUBMITTED WORKAROUND :
        setting priority to high as it hits us in SwingX particularly: we do have problems with Nimbus colors and SwingX renderers (not quite understood yet) which get much worse with this incorrect color alternation

              peterz Peter Zhelezniakov
              ndcosta Nelson Dcosta (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: