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

Nimbus and DefaultTableCellRenderer: must start with normal background

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 6u14
    • Fix Version/s: 7
    • Component/s: client-libs
    • Subcomponent:
    • Resolved In Build:
      b77
    • CPU:
      x86
    • OS:
      windows_vista

      Backports

        Description

        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

          Attachments

            Issue Links

              Activity

                People

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

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Imported:
                    Indexed: