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

Nimbus JList selection colors persist across L&F changes

    XMLWordPrintable

Details

    • b01
    • windows

    Backports

      Description

        FULL PRODUCT VERSION :
        JDK 7u45 b18, JDK 9, JDK 8

        A DESCRIPTION OF THE PROBLEM :
        The selectionBackground and selectionForeground colors installed on a JList by the Nimbus L&F are instances of javax.swing.plaf.nimbus.DerivedColor, which does not implement UIResource. Consequently, if the Nimbus L&F has been used, these colors then incorrectly persist when switching to another L&F.

        REPRODUCIBILITY :
        This bug can be reproduced always.

        CUSTOMER SUBMITTED WORKAROUND :
        As a workaround, override the JList's updateUI method as follows:

        @Override
        public void updateUI() {
        setSelectionBackground(new javax.swing.plaf.ColorUIResource(0));
        setSelectionForeground(new javax.swing.plaf.ColorUIResource(0));
        super.updateUI();
        }

        Attachments

          Issue Links

            Activity

              People

                alitvinov Anton Litvinov (Inactive)
                webbuggrp Webbug Group
                Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved: