-
Bug
-
Resolution: Fixed
-
P4
-
1.2.0, 1.3.0
-
hopper
-
x86
-
windows_nt
-
Verified
Name: nt126004 Date: 08/09/2001
java version "1.3.0"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0-C)
Java HotSpot(TM) Client VM (build 1.3.0-C, mixed mode)
On a JButton, press the left mouse button and, without releasing it, click the
right button. This (incorrectly) fires an ActionEvent and disarms the button.
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
class BTest extends JFrame
{
private JButton btn;
public BTest()
{
super("Button Test");
btn = new JButton("Click Me!!!");
btn.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
{
System.out.println("Action performed!");
return;
}
});
setBounds(0, 0, 150, 100);
btn.setBounds(25, 25, 100, 25);
getContentPane().setLayout(null);
getContentPane().add(btn);
setVisible(true);
return;
}
public static void main(String args[])
{
new BTest();
return;
}
}
(Review ID: 129696)
======================================================================
- duplicates
-
JDK-4213875 Incorrect JButton selection
- Closed
- relates to
-
JDK-8342602 Remove JButton/PressedButtonRightClickTest test
- Open
-
JDK-8049069 JButton incorrect behaviour on button release
- Resolved