import java.awt.*;
import javax.swing.*;

public class JButtonBug {
   public static void main(String[] args) {
      SwingUtilities.invokeLater(
         () -> {
            try {
               UIManager.setLookAndFeel("com.sun.java.swing.plaf.metal.MetalLookAndFeel");
               //Uncomment to see that it does work with Windows L&F.
               //UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
            }
            catch(Exception e) {}
            // Make focus rectangle very obvious.
            UIManager.put("Button.focus", new javax.swing.plaf.ColorUIResource(Color.RED));
            final JFrame frame = new JFrame();
            frame.getContentPane().add(new JButton("X"), "North");
            frame.getContentPane().add(new JButton(""), "Center");
            frame.setSize(600, 600);
            frame.setVisible(true);
         });
   }
} 