Alt+menmonic char not working when menu & menuitem have same mnemonic char.

XMLWordPrintable

    • 02
    • generic, x86, sparc
    • generic, linux, solaris_1, solaris_2.5.1, solaris_2.6, solaris_7, solaris_8, windows_95, windows_98, windows_nt
    • Verified

        JDK1.2.1-H build : Alt+menmonic char not working when menu & menuitem have same mnemonic char. This happens only on Windows platforms. Worked fine in JDK1.2.1-G build.

        Steps to simulate the problem,
        1. Run the attached program.
        2. There are 2 menus, 1 - First Menu and 2 - Second Menu. First Menu has menmonics for menuitems also. Second Menu does not have mnemonics set for menuitems
        3. Pressing Alt+1 does not drop down the list of menuitems.
        4. Pressing Alt+2 drops down the list of menuitems.

        --- Sample Code ---
        import java.awt.*;
        import java.util.*;
        import javax.swing.*;
        import java.awt.event.*;
        import javax.swing.border.*;

        public class Bug extends JFrame {
        public Bug() {
        Container content = getContentPane();
        content.setLayout(new BorderLayout());
        content.add("North", createMenuBar("1 - First Menu", true));
        content.add("South", createMenuBar("2 - Second Menu", false));
        pack();
        show();
        }

        public JMenuBar createMenuBar(String str, boolean bFlag) {
        JMenuBar menubar = new JMenuBar();
        JMenuItem menuitem;

        JMenu menu = new JMenu(str);
        menu.setMnemonic(str.charAt(0));

        menubar.add(menu);
        for(int i = 0; i < 10; i ++) {
        menuitem = new JMenuItem("JMenuItem" + i);
        if(bFlag)
        menuitem.setMnemonic('0' + i);
        menu.add(menuitem);
        }
        return menubar;
        }

        public static void main(String argv[]) {
        new Bug();
        }
        }

        --- Sample Code ---

        Name: skT88420 Date: 06/21/99


        I'm concerned that, in JDK 1.2.2RC, bug 4127078 is still not
        fixed. In a previous correspondence, you informed me that this
        behavior is covered under bug 4186905, which is marked fixed
        in a "non-public-release."

        While much of the behavior described in bug 4186905 now appears
        to be working, I hope that bug 4127078 hasn't slipped through
        the cracks.

        Here's what you wrote me in a previous release.

        "Thanks for your report. Believe me, we know this
        is still a problem. The reason there may be
        confusion re. the state of some bugs is that the
        problem appears to be getting worked on under bug
        # 4186905. It is definitely the same problem.
        Sorry this still exists in the current release,
        but I want to assure you that this bug has a high
        priority."

        If JDK 1.2.2 gets released without this fix (I hope, that doesn't
        happen) please consider reopening bug 4127078.
        (Review ID: 84626)
        ======================================================================
        al.smith@eng 2000-12-18
        The test name of one of the included bugs is Regression test:
        javax/swing/JMenu/4213634/bug4213634.java from bug 4376660

        |-*-*-*-|-*-*-*-|-*-*-*-|-*-*-*-|-*-*-*-|-*-*-*-|-*-*-*-|-*-*-*-|

        al.smith@eng 2001-02-02
        The regression test that demonstrates this failure:
        javax/swing/JMenu/4213634/bug4213634.java
        Was successfully fixed with Ladybird as of b14 but still fails with Merlin b50.
        I'm resetting this bug to NYI for the Merlin verification failure.

              Assignee:
              Scott Violet (Inactive)
              Reporter:
              Mukund Madhugiri (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: