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

PopupMenu.show method always brings menu to the upper left corner

    XMLWordPrintable

Details

    • x86
    • linux

    Description



      Name: kaC94536 Date: 11/19/99



      Java 2 Platform SE v1.3 specification reads:

      ...
      public void show(Component origin,
                       int x,
                       int y)

                Shows the popup menu at the x, y position relative to an origin
      component.
      ...

      But the following test always shows popup menu at the upper left corner of
      the screen. Such behavior of PopupMenu.show method was found both in runs with
      JIT and without JIT.

      This bug affects api/java_awt/interactive/PMenuTest.html JCK test.

      ----------------------------- test.java ------------------------
      import java.awt.Frame;
      import java.awt.Menu;
      import java.awt.PopupMenu;

      public class Test {
         static PopupMenu popup = null;
         static Frame testFrame = null;

         public static void main( String[] argv ) {
            testFrame = new Frame();
            testFrame.setSize(700,400);

            popup = new PopupMenu("Popup Menu Title");
            Menu menu = new Menu("Menu");
            popup.add(menu);
            testFrame.add(popup);
            testFrame.setVisible(true);

            popup.show(testFrame, 50,50);
         }
      }
      ======================================================================

      ======================================================================

      Attachments

        Activity

          People

            mbronsonsunw Mike Bronson (Inactive)
            kanisimosunw Konstantin Anisimov (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: