Focus border of JButton.buttonType=roundRect is cut off

Sergey Bylokhov Sergey.Bylokhov at oracle.com
Mon Nov 25 03:36:29 PST 2013


Hi, Hendrik.
Looks like the similar issue was fixed for textured buttons:
https://bugs.openjdk.java.net/browse/JDK-8000435
It would be good if you create a new issue. Thanks!

On 25.11.2013 12:52, Hendrik Schreiber wrote:
> 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);
>              }
>          });
>      }
>
> }
>


-- 
Best regards, Sergey.



More information about the macosx-port-dev mailing list