-
Bug
-
Resolution: Duplicate
-
P2
-
None
-
1.4.0
-
x86
-
windows_2000
###@###.### 2001-08-24
J2SE Version (please include all output from java -version flag):
java version "1.4.0-beta2"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-beta2-b76)
Java HotSpot(TM) Client VM (build 1.4.0-beta2-b76, mixed mode)
Did not occur in previous 1.4 cap builds.
Does this problem occur on J2SE 1.3? Yes / No (pick one)
No.
Operating System Configuration Information (be specific):
Windows 2000SP2
Hardware Configuration Information (be specific):
Intel PIII-800, 256MB RAM, Nvidia Geforce256 Grafikkarte
Bug Description:
MouseEvent.isPopupTrigger() always returns false in the latest CAP build b76.
While changing the modifiers back to 1.1 modifiers (without
BUTTON1_DOWN_MASK etc...) is good thing for compatibility,
removing isPopupTrigger() to always return false is certainly not intended.
Test case output on 1.3.1:
button pressed
modifiers: 4
isPopupTrigger: false
button released
modifiers: 4
isPopupTrigger: true
button clicked
modifiers: 4
isPopupTrigger: false
1.4 public beta(b65):
button pressed
modifiers: 32772
isPopupTrigger: false
button released
modifiers: 36868
isPopupTrigger: true
button clicked
modifiers: 36868
isPopupTrigger: false
1.4 cap build 74 (erroneous):
button pressed
modifiers: 4
isPopupTrigger: false
button released
modifiers: 4
isPopupTrigger: false
button clicked
modifiers: 4
isPopupTrigger: false
Steps to Reproduce (be specific):
Run the attached Java application(IsPopupTriggerTest.java), click the
right mouse button on the "Press me" button and observe that no event
is dispatched which has isPopupTrigger() set to true.
Test program(IsPopupTriggerTest.java):
---------------------------------------------------
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
/**
* Short application to show off the newly introduces bug in MouseEvent.isPopupTrigger():
*
* Steps to reproduce:
*
* - Start the application and press the right mouse button on the "Press me" button.
* - Observe that there is no even generated for which isPopupTrigger() returns true.
*/
public class IsPopupTriggerTest
{
public static void main(String[] args)
{
JFrame f = new JFrame();
f.getContentPane().setLayout(new GridLayout(1,1));
JButton button1 = new JButton("Press me");
button1.addMouseListener
(
new MouseAdapter()
{
public void mousePressed(MouseEvent e)
{
System.out.println("button pressed");
System.out.println("modifiers: "+e.getModifiers());
System.out.println("isPopupTrigger: "+e.isPopupTrigger());
System.out.println();
}
public void mouseClicked(MouseEvent e)
{
System.out.println("button clicked");
System.out.println("modifiers: "+e.getModifiers());
System.out.println("isPopupTrigger: "+e.isPopupTrigger());
System.out.println();
}
public void mouseReleased(MouseEvent e)
{
System.out.println("button released");
System.out.println("modifiers: "+e.getModifiers());
System.out.println("isPopupTrigger: "+e.isPopupTrigger());
System.out.println();
}
}
);
f.getContentPane().add(button1);
f.pack();
f.show();
}
}
- duplicates
-
JDK-4492177 JCK: method isPopupTrigger does not work as expected
-
- Closed
-