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

isPopupTrigger never returns true on Windows

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not an Issue
    • Icon: P4 P4
    • None
    • 1.1.5, 1.1.6, 1.2.0
    • client-libs
    • x86
    • windows_95, windows_nt



      Name: rm29839 Date: 03/12/98


      The isPopupTrigger bug is still present in
      Windows (see bug 4070464).

      Run the following code using Swing 1.0 upwards and
      1.1.5 or 1.2beta2 and the popupmenu will never be
      displayed since on Windows NT (I've not tried 95)
      isPopupTrigger is never! true in mousePressed()
      only mouseReleased()

      This code is from george saab of the swing team

      import java.awt.*;
      import java.awt.event.*;
      import com.sun.java.swing.*;
      // use this one if we are using 1.2
      //import java.awt.swing.*;

      class t2 extends JFrame {
      public void init() {
      final JPopupMenu m = new JPopupMenu();
      m.add(new JMenuItem("Wombat"));
      m.add(new JMenuItem("Sussex"));
      m.add(new JMenuItem("Kizumbo"));
      addMouseListener(new MouseAdapter() {
      public void mousePressed(MouseEvent e) {
      if (e.isPopupTrigger() == true) {
      m.show(e.getComponent(), e.getX(), e.getY());
      }
      }
      });
      }

      public static void main(String[] args) {
      t2 test = new t2();
      test.init();
      test.setSize(200,100);
      test.setTitle("Popup Menu Example");
      test.show();
      }
      }
       
      This code works fine under Solaris and HPUX but
      not NT. This is a bug and 4070464 should not of
      been closed...
      (Review ID: 26120)
      ======================================================================

            tballsunw Tom Ball (Inactive)
            rmandelsunw Ronan Mandel (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: