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

Focus border of JButton.buttonType=roundRect is cut off

    XMLWordPrintable

    Details

    • Subcomponent:
    • Resolved In Build:
      b11
    • OS:
      os_x

      Backports

        Description

        FULL PRODUCT VERSION :
        java version "1.7.0_45"
        Java(TM) SE Runtime Environment (build 1.7.0_45-b18)
        Java HotSpot(TM) 64-Bit Server VM (build 24.45-b08, mixed mode)

        ADDITIONAL OS VERSION INFORMATION :
        Darwin Macintosh-7.local 13.0.2 Darwin Kernel Version 13.0.2: Sun Sep 29 19:38:57 PDT 2013; root:xnu-2422.75.4~1/RELEASE_X86_64 x86_64

        A DESCRIPTION OF THE PROBLEM :
        The blue focus border of a "roundRect" JButton (as originally defined in https://developer.apple.com/library/mac/technotes/tn2007/tn2196.html) is cut off left and right in the current Oracle 1.7.0_45 release. Seems like something with the sizing is off.

        I uploaded a screenshot to http://www.tagtraum.com/download/focus_border.png
        (please remove this link after you attached the screenshot to the bug report)

        This bug may be related to https://bugs.openjdk.java.net/browse/JDK-8000435

        REGRESSION. Last worked in version 7u45

        ADDITIONAL REGRESSION INFORMATION:
        java version "1.7.0_45"
        Java(TM) SE Runtime Environment (build 1.7.0_45-b18)
        Java HotSpot(TM) 64-Bit Server VM (build 24.45-b08, mixed mode)

        STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
        Create a Swing UI with a button in JButton.buttonType = roundRect style. Make sure the button has the focus.

        EXPECTED VERSUS ACTUAL BEHAVIOR :
        EXPECTED -
        The blue focus border of the button should be intact.
        ACTUAL -
        The focus border is cut off left and right.

        REPRODUCIBILITY :
        This bug can be reproduced always.

        ---------- BEGIN SOURCE ----------
        import javax.swing.*;
        import java.awt.*;

        public class RoundedRectangleButton {

            public static void main(String[] args) {
                final JFrame frame = new JFrame();
                frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
                frame.getContentPane().setLayout(new BorderLayout());
                final JButton button = new JButton("FocusedButton");
                button.putClientProperty("JButton.buttonType", "roundRect");
                frame.add(button, BorderLayout.NORTH);
                frame.add(new JPanel(), BorderLayout.CENTER);
                SwingUtilities.invokeLater(new Runnable() {
                    public void run() {
                        frame.setBounds(200, 200, 200, 70);
                        frame.setVisible(true);
                    }
                });
            }

        }

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

          Attachments

            Issue Links

              Activity

                People

                Assignee:
                serb Sergey Bylokhov
                Reporter:
                webbuggrp Webbug Group
                Votes:
                0 Vote for this issue
                Watchers:
                8 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved: