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

Auditory feedback for JMenu components on Windows L&F not working

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P2 P2
    • 1.4.0
    • 1.4.0
    • client-libs
    • beta
    • x86
    • windows_2000
    • Verified

      If you run the following program on a Windows OS and select a JMenu and a JMenuItem, the following gets output to the screen:

      com.sun.java.swing.plaf.windows.WindowsLookAndFeel/sounds/PopupMenuPopup.wav not found.
      com.sun.java.swing.plaf.windows.WindowsLookAndFeel/sounds/MenuItemCommand.wav not found.

      ---------------------------------- Cut Here ----------------------------------

      import java.awt.event.*;
      import javax.swing.*;

      public class JMenuItemTest extends JFrame {
          private JMenuBar menuBar;
          private JMenu menu, menu2;
          private JMenuItem menuItem, menuItem1, menuItem2, menuItem3;

          public static void main(String[] args) {
              new JMenuItemTest();
          }

          public JMenuItemTest() {
              menuBar = new JMenuBar();
              menu = new JMenu("Stuff");
              menu2 = new JMenu("More Stuff");
              menuItem = new JMenuItem("Hello");
              menuItem1 = new JMenuItem("World");
              menuItem2 = new JMenuItem("Greetings");
              menuItem3 = new JMenuItem("There");

              menu.add(menuItem);
              menu.add(menuItem1);
              menu2.add(menuItem2);
              menu2.add(menuItem3);

              menuBar.add(menu);
              menuBar.add(menu2);

              setJMenuBar(menuBar);

              try {
                  UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
              } catch(Exception e) {
                  e.printStackTrace();
              }

              setSize(300, 300);
              setVisible(true);
          }
      }

      ---------------------------------- Cut Here ----------------------------------


      edmund.lou@eng 2001-01-23
      Swing Test Development
      ====================================

            svioletsunw Scott Violet (Inactive)
            elousunw Edmund Lou (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: