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

XToolkit: Inserting a MenuItem and setting a shortcut throws NPE

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P3 P3
    • None
    • 6
    • client-libs
    • generic
    • generic

      Setting a shortcut to an inserted MenuItem throws NullPointerException:

      Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
              at sun.awt.X11.XMenuPeer.repaintMenuItem(XMenuPeer.java:360)
              at sun.awt.X11.XMenuItemPeer.setLabel(XMenuItemPeer.java:60)
              at java.awt.MenuItem.setShortcut(MenuItem.java:309)

      This happens only with XToolkit. Works fine with Motif toolkit and in Windows. This is reproducible from tiger beta3 onwards. This happens only when Menu is not dropped down even once before insertion.

      Steps to reproduce:
      1. Run the attached testcase
      2. When the Test Frame comes up, click the button 'Insert a MenuItem' on the Frame. Check the terminal window for the exception.

      The exception does not occur if the menu button Menu0 is clicked before inserting the MenuItem.
      ###@###.### 2004-12-28 09:06:52 GMT

            Unassigned Unassigned
            gramachasunw Girish Ramachandran (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: