JDK-6789983 : Nimbus tooltips on disabled components have no border, and wrong background colo
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 6u10
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_vista
  • CPU: x86
  • Submitted: 2009-01-05
  • Updated: 2017-08-03
  • Resolved: 2017-08-03
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 10
10Resolved
Related Reports
Duplicate :  
Duplicate :  
Description
FULL PRODUCT VERSION :
java version "1.6.0_11"
Java(TM) SE Runtime Environment (build 1.6.0_11-b03)
Java HotSpot(TM) Client VM (build 11.0-b16, mixed mode, sharing)

ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows [Version 6.0.6001]

A DESCRIPTION OF THE PROBLEM :
With Nimbus LAF, tooltips have a yellow background and black border.

  Tooltips for disabled components, however, have no border, and the background color matches the background color of the panel. So all you see is the tooltip's label floating on the panel, which looks really bad.

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Just create a panel with one enabled JButton, and a second disabled JButton. The tooltip works for the enabled button, but you see the "grey box" tooltip with no border on the second button.

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Both tooltips should look the same. If you prefer a different disabled background color, that's fine also, but at least include a border around tooltips for disabled components.
ACTUAL -
Grey, borderless tips.

REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
public class TooltipBug extends JFrame {
    public static void main(String[] args) {
        SwingUtilities.invokeLater(new Runnable() {
            public void run() {
                try {
                    UIManager.setLookAndFeel("com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel");
                } catch (Exception e) {
                    e.printStackTrace();
                }
                new TooltipBug().setVisible(true);
            }
        });
    }

    public TooltipBug() {
        // un-comment these lines for the workaround
        //UIManager.put("ToolTip[Disabled].backgroundPainter",
        //        UIManager.get("ToolTip[Enabled].backgroundPainter"));


        JButton b1 = new JButton("One");
        b1.setToolTipText("Button 1");

        JButton b2 = new JButton("One");
        b2.setEnabled(false);
        b2.setToolTipText("Button 2");

        Container c = getContentPane();
        c.setLayout(new FlowLayout());
        c.add(b1);
        c.add(b2);

        pack();
        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    }
}
---------- END SOURCE ----------

CUSTOMER SUBMITTED WORKAROUND :
UIManager.put("ToolTip[Disabled].backgroundPainter",
      UIManager.get("ToolTip[Enabled].backgroundPainter"));

Comments
This issue is a duplicate of JDK-8058785 and is resolved now.
03-08-2017

The bug is related to another bug which was fixed recently.
02-08-2017