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

MenuShortcut in menu not working in Java 6

    Details

    • Subcomponent:
    • CPU:
      x86
    • OS:
      windows_xp

      Description

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

      ADDITIONAL OS VERSION INFORMATION :
      Microsoft Windows XP [Version 5.1.2600]

      A DESCRIPTION OF THE PROBLEM :
      MenuShortcuts does not show in an MenuItem.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Se example code:
      When clicking in the frame a menu pops up with one menuitem containing the label "test" and menushortcut "CTRL+A".


      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      A menu with one menuitem containing the label "test" and menushortcut "CTRL+A"
      ACTUAL -
      A menu with one menuitem containing the label "test" with no menushortcut text

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      import java.awt.*;
      import java.awt.event.*;

      public class TestMenuShortcut extends Frame implements MouseListener {


        public TestMenuShortcut() throws HeadlessException {
          super();
          addMouseListener(this);
          setSize(100, 100);
          setVisible(true);
        }
        
        public void mouseClicked(MouseEvent e) {
          PopupMenu m = new PopupMenu("test");
          add(m);
          MenuItem mi = new MenuItem("test", new MenuShortcut(KeyEvent.VK_A));
          m.add(mi);
          m.show(this, e.getX(), e.getY());
        }
        public void mousePressed(MouseEvent e) {
        }
        public void mouseReleased(MouseEvent e) {
        }
        public void mouseEntered(MouseEvent e) {
        }
        public void mouseExited(MouseEvent e) {
        }
        
        public static void main(String[] args) {
          new TestMenuShortcut();
        }
      }



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

      Release Regression From : 5.0u12
      The above release value was the last known release where this
      bug was not reproducible. Since then there has been a regression.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                ndcosta Nelson Dcosta (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: