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

[macosx] system menu bar disabled when using webstart to start

    Details

    • Subcomponent:
    • CPU:
      x86
    • OS:
      other

      Description

      FULL PRODUCT VERSION :
      java version "1.8.0_40"
      Java(TM) SE Runtime Environment (build 1.8.0_40-b25)
      Java HotSpot(TM) 64-Bit Server VM (build 25.40-b25, mixed mode)

      ADDITIONAL OS VERSION INFORMATION :
      Mac OS X 10.10.2

      EXTRA RELEVANT SYSTEM CONFIGURATION :
      Java Web Start 11.40.2.25
      Using JRE version 1.8.0_40-b25 Java HotSpot(TM) 64-Bit Server VM

      A DESCRIPTION OF THE PROBLEM :
      After upgrading Java 8 to update 40, the system menu bar did not show up when starting app using WebStart with System property "apple.laf.useScreenMenuBar" set to true.

      The system menu bar did show up, when running the app from command line (e.g. java -jar app.jar). This issue seems to only happen when staring the app using WebStart JNLP.

      This maybe related to the fix in JDK-8048549?

      REGRESSION. Last worked in version 8u31

      ADDITIONAL REGRESSION INFORMATION:
      Java Web Start 11.31.2.13
      Using JRE version 1.8.0_31-b13 Java HotSpot(TM) 64-Bit Server VM

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      1. setup swing java app with native/system menubar to start with webstart

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      The app menubar will be shown in the Mac OS system menubar.
      ACTUAL -
      The app menubar did not show in the Mac OS system menubar.

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      /*
       * sample app with native menubar
       */
      import java.awt.BorderLayout;

      import javax.swing.JFrame;
      import javax.swing.JLabel;
      import javax.swing.JMenu;
      import javax.swing.JMenuBar;
      import javax.swing.JMenuItem;
      import javax.swing.JPanel;

      import javax.swing.SwingConstants;
      import javax.swing.SwingUtilities;
      import javax.swing.WindowConstants;
      import javax.swing.border.CompoundBorder;
      import javax.swing.border.EmptyBorder;

      public class MacMenubarDisappearDemo {
        
        public static void main(final String[] args) {
          System.setProperty("apple.laf.useScreenMenuBar", "true");
          
          SwingUtilities.invokeLater(new Runnable() {
            public void run() {
              String frameTitle = "JFrame";
              final JFrame frame = new JFrame(frameTitle);
          
              frame.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
              
              final JMenuBar menuBar = new JMenuBar();
              
              final JMenu menu = new JMenu("About");
              menu.add(new JMenuItem("Test"));
              menuBar.add(menu);
              frame.setJMenuBar(menuBar);
              
              final JPanel panel = new JPanel();
              panel.setBorder(new CompoundBorder(panel.getBorder(), new EmptyBorder(10, 10, 10, 10)));
              panel.setLayout(new BorderLayout());

              final JLabel label = new JLabel("This is a frame with native menubar", SwingConstants.CENTER);
              label.setFont(label.getFont().deriveFont(24.0f));
              label.setBorder(new CompoundBorder(new EmptyBorder(10, 10, 10, 10), label.getBorder()));

              panel.add(label, BorderLayout.NORTH);

              frame.add(panel);
              frame.pack();
              frame.setLocationRelativeTo(null);
              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:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: