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

REGRESSION: WinXP LaF: Disabled JButtons have black border

XMLWordPrintable

    • b01
    • b86
    • generic, x86
    • generic, windows_xp, windows_vista

        FULL PRODUCT VERSION :
        java version "1.6.0-ea"
        Java(TM) 2 Runtime Environment, Standard Edition (build 1.6.0-ea-b56)
        Java HotSpot(TM) Client VM (build 1.6.0-ea-b56, mixed mode, sharing)

        ADDITIONAL OS VERSION INFORMATION :
        Microsoft Windows XP [Version 5.1.2600]

        A DESCRIPTION OF THE PROBLEM :
        Disabled JButtons have a black border around their edges when using the Windows XP look and feel.

        It seems that the problem only manifests itself when I use the "Olive Green"
        theme. If I use "Default (blue)" or "Silver", the problem isn't there. I
        have uploaded a screenshot of the test program running under the three
        themes that come with Windows XP.[1] Of them, only the Olive Green one
        displays the black border.

        [1] http://www.cse.ohio-state.edu/~eckenror/Java/Disabled%20Buttons.png<http://www.cse.ohio-state.edu/%7Eeckenror/Java/Disabled%20Buttons.png>

        STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
        Observe any disabled JButton in the Windows XP look and feel.

        EXPECTED VERSUS ACTUAL BEHAVIOR :
        EXPECTED -
        The button looks like it does in native apps and did in Tiger.
        ACTUAL -
        The button has a black border when disabled.

        REPRODUCIBILITY :
        This bug can be reproduced always.

        ---------- BEGIN SOURCE ----------
        import javax.swing.JButton;
        import javax.swing.JFrame;
        import javax.swing.UIManager;

        public class Main {
            public static void main(String[] args) throws Exception {
                UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
                
                JFrame frame = new JFrame();
                frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                
                JButton button = new JButton("Disabled Text");
                button.setEnabled(false);
                
                frame.add(button);
                frame.pack();
                frame.setVisible(true);
            }
        }

        ---------- END SOURCE ----------

              bchristi Brent Christian
              jssunw Jitender S (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: