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

[macosx] Running java -Xdock:name=SwingApp doesn't set the dock name correct

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 8u40, 9
    • client-libs

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

      ADDITIONAL OS VERSION INFORMATION :
      Darwin MacBook-Pro.local 14.1.0 Darwin Kernel Version 14.1.0: Thu Feb 26 19:26:47 PST 2015; root:xnu-2782.10.73~1/RELEASE_X86_64 x86_64

      A DESCRIPTION OF THE PROBLEM :
      Running a simple Swing application using the java command from the command line with the mac specific option -Xdock:name=<application name> doesn't set the name in the dock correctly but always shows "java".

      ADDITIONAL REGRESSION INFORMATION:
      java version "1.8.0_40"
      Java(TM) SE Runtime Environment (build 1.8.0_40-b27)
      Java HotSpot(TM) 64-Bit Server VM (build 25.40-b25, mixed mode)

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      run the code as follows:
      java -Xdock:name=SwingTest SwingTest

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      See the name SwingTest as application name in the dock. Instead it shows java
      ACTUAL -
      The dock shows java as application name

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      import javax.swing.JFrame;
      import javax.swing.SwingUtilities;

      public class SwingTest {

      public SwingTest() {
      JFrame frame = new JFrame("SwingTest");
      frame.pack();
      frame.setVisible(true);
      }

      public static void main(String[] args) {
      System.setProperty("apple.laf.useScreenMenuBar", "true");
      System.setProperty("com.apple.mrj.application.apple.menu.about.name", "SwingTest");

      try {
      SwingUtilities.invokeAndWait(new Runnable() {

      @Override
      public void run() {
      SwingTest s = new SwingTest();
      }
      });
      } catch (Exception e) {
      }
      }
      }

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

            ssadetsky Semyon Sadetsky (Inactive)
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: