Focus border of JButton.buttonType=roundRect is cut off

Hendrik Schreiber hs at tagtraum.com
Mon Nov 25 00:52:10 PST 2013


Hi,

the focus border of a "roundRect" JButton (as originally defined in https://developer.apple.com/library/mac/technotes/tn2007/tn2196.html — I couldn't find a more recent documentation) 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

Is this a known issue, or should I file a bug report at http://bugreport.sun.com/bugreport/ (or is there a better place?)?

Thanks,

-hendrik

Code to reproduce on 1.7.0_45 on OS X 10.9:

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

}



More information about the macosx-port-dev mailing list