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

WinNT-Showing frame containing menu with null string item causes mem. ref. error

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 1.1
    • client-libs
    • x86
    • windows_nt


      The following application creates a frame that contains a menu whose
      item is a null string.

      An attempt to show the frame causes a memory reference error on
      Windows NT:

        The instruction at "0x77a055e6" referenced memory at "0x00000000".
        The memory could not be "read".



              import java.awt.*;

              public class MenuTest extends Frame {

                      public MenuTest(String title)
                      {
                              super(title);

                              setSize(300, 300);

                              MenuBar mb = new MenuBar();
                              Menu m = new Menu("File", false);

                              String s = null;
      System.out.println("Adding null string to menu.. ");
                              m.add(s);

      MenuItem mi = m.getItem(0);
      System.out.println("Item 0 is " + mi);

      System.out.println("Adding menu to menubar.. ");
                              mb.add(m);

      System.out.println("Setting menubar.. ");
                              setMenuBar(mb);
                      }

                      public static void main(String args[])
                      {
                              Frame f = new MenuTest("menu test");

      System.out.println("Showing frame.. ");
      f.setVisible(true);
                      }
              }


            cchongsunw Creighton Chong (Inactive)
            gaurisha Gauri Sharma (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: