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

[macosx] Multiple defects when starting Swing application with splash screen on Mac

XMLWordPrintable

      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 :
      OS 10.10.1

      A DESCRIPTION OF THE PROBLEM :
      When starting a swing application with the options -Dapple.laf.useScreenMenuBar="true" and -splash, the following defects occur:
      - Application menu is not displayed
      - No dock Icon is displayed
      - Keyboard shortcuts (e.g. for application shutdown via Cmd-Q) do not work
      - Main frame opens in the background

      All these do not occur when using JDK 8u25


      REGRESSION. Last worked in version 8u25

      ADDITIONAL REGRESSION INFORMATION:
      java version "1.8.0_25"
      Java(TM) SE Runtime Environment (build 1.8.0_25-b17)
      Java HotSpot(TM) 64-Bit Server VM (build 25.25-b02, mixed mode)


      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Start the application below (source code field) with the VM args:
      -Dapple.laf.useScreenMenuBar="true" -splash:/path/to/arbitrary/image




      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      - Application menu is displayed
      - Dock Icon is displayed
      - Keyboard shortcuts (e.g. for application shutdown via Cmd-Q) work
      - Main frame opens in the foreground

      ACTUAL -
      - Application menu is not displayed
      - No dock Icon is displayed
      - Keyboard shortcuts (e.g. for application shutdown via Cmd-Q) do not work
      - Main frame opens in the background


      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------

      import javax.swing.JFrame;
      import javax.swing.JMenu;
      import javax.swing.JMenuBar;

      public class SplashBugMac {
          public static void main(String[] args){
              final JFrame frame = new JFrame(SplashBugMac.class.getSimpleName());
              final JMenuBar menuBar = new JMenuBar();
              menuBar.add(new JMenu("Test Menu"));
              frame.setJMenuBar(menuBar);
              frame.setSize(400, 400);
              frame.setVisible(true);
          }
      }
      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      Remove the -splash option and implement a splash screen in the application.

            serb Sergey Bylokhov
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: