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

vista: Swing menu bar doesn't look and feel like that of a native app

    XMLWordPrintable

    Details

      Description

      FULL PRODUCT VERSION :
      java version "1.6.0"
      Java(TM) SE Runtime Environment (build 1.6.0-b105)
      Java HotSpot(TM) Client VM (build 1.6.0-b105, mixed mode, sharing)

      ADDITIONAL OS VERSION INFORMATION :
      Microsoft Windows [Version 6.0.6000]

      A DESCRIPTION OF THE PROBLEM :
      Under Vista, the Swing menu bar looks and behaves somewhat differently from native applications running on the same OS.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Compile and run the sample application. Run Notepad alongside for the purpose of comparison.


      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      1. The menu background colour should be blueish with a gradient.
      2. Menu items being hovered over should be highlighted in a light blue.
      3. Clicking on a disabled menu item should not hide the menu.

      ACTUAL -
      1. The menu background colour is flat grey.
      2. Menu items being hovered over are highlighted in a deep blue.
      3. Clicking on a disabled menu item hides the menu.


      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      import javax.swing.*;
      import com.sun.java.swing.plaf.windows.WindowsLookAndFeel;

      public class Test {
          public void main(String[] args) throws Exception {
              UIManager.setLookAndFeel(new WindowsLookAndFeel());
              JFrame frame = new JFrame("Title");
              JMenuBar menuBar = new JMenuBar();
              JMenu fileMenu = new JMenu("File");
              JMenuItem disabledMenuItem = new JMenuItem("Disabled");
              disabledMenuItem.setEnabled(false);
              fileMenu.add(disabledMenuItem);
              menuBar.add(fileMenu);
              frame.setJMenuBar(menuBar);
              frame.setSize(400, 300);
              frame.setVisible(true);
          }
      }

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

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              idk Igor Kushnirskiy (Inactive)
              Reporter:
              ndcosta Nelson Dcosta (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: