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

PopupMenu.setEnabled crashes JVM (win32 only, 1.1.x only)

XMLWordPrintable

    • x86
    • windows_nt



      Name: diC59631 Date: 10/07/97


      Calling setEnabled for a PopupMenu after the
      parent window is shown crashes the virtual
      machine.

      Sample code:
      // --- begin of sample code
      import java.awt.*;
      import java.awt.event.*;

      class bug extends Frame
      {
        public static void main(String args[]) {
          new bug();
        }

        public bug() {
          super("Buggy Popup Menu");
          PopupMenu popup = new PopupMenu();
          add(popup);

          popup.setEnabled(false); // this one is ok
          show();
          popup.setEnabled(false); // this crashes the VM
        }
      }
      // --- end of sample code
      ======================================================================

      erik.larsen@Eng 1998-05-12
      Here's another test case, (web-bug):

      a good reason to enable/disable a popup, it
      shouldn't crash... I found in in using a generic
      MenuItem utility I wrote.

      import java.awt.*;

      public class test
      {
         public static void main(String args[])
         {
            Frame frame = new Frame();
            frame.show();
            
            PopupMenu pop = new PopupMenu();
            pop.add(new MenuItem("Item 1"));
            pop.add(new MenuItem("Item 2"));
            frame.add(pop);
            pop.setEnabled(false);
         }
      }

            ibdsunw Ibd Ibd (Inactive)
            dindrigo Daniel Indrigo (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: