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

[macosx] JPopupMenus in Swing don't have rounded corners on OS X

XMLWordPrintable

      FULL PRODUCT VERSION :
      java version "1.8.0-ea"
      Java(TM) SE Runtime Environment (build 1.8.0-ea-b117)
      Java HotSpot(TM) 64-Bit Server VM (build 25.0-b59, mixed mode)

      ADDITIONAL OS VERSION INFORMATION :
      Darwin mankell 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

      This is OS X 10.9.1, Mavericks

      A DESCRIPTION OF THE PROBLEM :
      Popup menus of native apps on OS X have rounded corners.
      Contrary to this behavior, Java Swing apps currently have rectangular corners.

      It seems like this has worked properly in earlier versions. See https://developer.apple.com/library/mac/releasenotes/CrossPlatform/JavaSnowLeopardUpdate1LeopardUpdate6RN/NewandNoteworthy/NewandNoteworthy.html



      ADDITIONAL REGRESSION INFORMATION:
      Please see

      https://developer.apple.com/library/mac/releasenotes/CrossPlatform/JavaSnowLeopardUpdate1LeopardUpdate6RN/NewandNoteworthy/NewandNoteworthy.html

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Create a JPopupMenu and add it to a component via setComponentPopupMenu(menu).
      Open the popup menu with a right-click.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      The appearing popup menu should have rounded corners.
      ACTUAL -
      The popup menu has rectangular corners.

      REPRODUCIBILITY :
      This bug can be reproduced always.

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

      public class Popup {


          public static void main(String[] args) {
              final JFrame frame = new JFrame();
              final JLabel label = new JLabel("Label");
              final JPopupMenu popup = new JPopupMenu();
              popup.add(new JMenuItem("Item"));
              label.setComponentPopupMenu(popup);
              frame.add(label);
              SwingUtilities.invokeLater(new Runnable() {
                  @Override
                  public void run() {
                      frame.setBounds(100, 100, 100, 100);
                      frame.setVisible(true);
                  }
              });
          }
      }

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

            dnguyen Damon Nguyen
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: