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

PopupMenu cannot display its cascaded submenu

XMLWordPrintable

    • x86
    • windows_98

      Running jdk1.3 the PopupMenu only displays its menu but will not go
      into the cascaded submenu.

      The following works fine on Solaris and Win98 running jdk1.2fcs but
      not on Win98 running jdk1.3-version-O

      -----------------------------------------------------------------------

      import java.awt.*;
      import java.awt.event.*;

      public class popup extends Frame {
          public static void main(String argv[] ) {
              popup m = new popup();
          }

          public popup () {

      setTitle("Test Frame");
      setVisible(true);
      setSize(200, 200);
      addWindowListener(new WindowAdapter() {
      public void windowClosing(WindowEvent we) {
      System.exit(0);
      }
      });

      add(new popupPanel());
      validate();
          }


          class popupPanel extends Panel {
      PopupMenu popup;

      public popupPanel() {
      setLayout(new FlowLayout());
      setBackground(Color.yellow);

      popup = new PopupMenu("Popup Menu Title");
      MenuItem mi = new MenuItem("Menu Item");
      Menu menu = new Menu("Menu");
      MenuItem mi1 = new MenuItem("Menu Item 1");
      MenuItem mi2 = new MenuItem("Menu Item 2");
      popup.add(mi);
      menu.add(mi1);
      menu.add(mi2);
      popup.add(menu);;
      add(popup);
      enableEvents(AWTEvent.MOUSE_EVENT_MASK);
      }

      public void processMouseEvent(MouseEvent e) {
      // System.out.println("got here!");j
      if (e.isPopupTrigger()) {
      popup.show(e.getComponent(), e.getX(), e.getY());
      }
      super.processMouseEvent(e);
      }

          }
      }
      -----------------------------------------------------------------------
      Roger Pham 9/27/99

      Red status tag removed, Roger Pham 11/2/99

            ehawkessunw Eric Hawkes (Inactive)
            rphamsunw Roger Pham (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: