Nimbus ToolTip Bug

I just submitted a bug report to Sun for this bug. With Nimbus on Java6u11, tool tips for disabled components have no border, and the tool tip background exactly matches the panel background color. Here is a sample program with the workaround commented out.

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);     } }

*** UPDATE: They accepted my bug report. It is Bug ID 6789983.

Leave a Reply

Your email address will not be published. Required fields are marked *