-
Bug
-
Resolution: Fixed
-
P3
-
1.4.0
-
tiger
-
x86
-
windows_nt
Name: rmT116609 Date: 06/24/2002
FULL PRODUCT VERSION :
java version "1.4.0"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-b92)
Java HotSpot(TM) Client VM (build 1.4.0-b92, mixed mode)
FULL OPERATING SYSTEM VERSION :
Windows NT Version 4.0
A DESCRIPTION OF THE PROBLEM :
VK_PRINTSCREEN is not delivered to actions in ActionMap.
Note that neither key-press nor key-release is working, so
this is NOT bug 4455060.
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class PrintTest extends JFrame {
private JTextField textField = new JTextField(10);
public PrintTest() {
JPanel panel = new JPanel();
setContentPane(panel);
panel.add(textField);
panel.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put
(KeyStroke.getKeyStroke(KeyEvent.VK_PRINTSCREEN,
0 ), "PRESSED");
panel.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put
(KeyStroke.getKeyStroke(KeyEvent.VK_PRINTSCREEN, 0,
true), "RELEASED");
panel.getActionMap().put("PRESSED", new AbstractAction
() {
public void actionPerformed(ActionEvent ev) {
System.out.println("ActionMap pressed");
}
});
panel.getActionMap().put("RELEASED", new AbstractAction
() {
public void actionPerformed(ActionEvent ev) {
System.out.println("ActionMap released");
}
});
}
public static void main(String[] args) {
PrintTest test = new PrintTest();
test.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
test.pack();
test.setVisible(true);
}
}
REGRESSION. Last worked in version 1.3.1
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. Compile and run class PrintTest
2. Hit the "Printscreen" button
EXPECTED VERSUS ACTUAL BEHAVIOR :
"ActionMap released" should be printed on the console but
nothing happens.
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class PrintTest extends JFrame {
private JTextField textField = new JTextField(10);
public PrintTest() {
JPanel panel = new JPanel();
setContentPane(panel);
panel.add(textField);
panel.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put
(KeyStroke.getKeyStroke(KeyEvent.VK_PRINTSCREEN, 0 ), "PRESSED");
panel.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put
(KeyStroke.getKeyStroke(KeyEvent.VK_PRINTSCREEN, 0, true), "RELEASED");
panel.getActionMap().put("PRESSED", new AbstractAction() {
public void actionPerformed(ActionEvent ev) {
System.out.println("ActionMap pressed");
}
});
panel.getActionMap().put("RELEASED", new AbstractAction() {
public void actionPerformed(ActionEvent ev) {
System.out.println("ActionMap released");
}
});
}
public static void main(String[] args) {
PrintTest test = new PrintTest();
test.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
test.pack();
test.setVisible(true);
}
}
---------- END SOURCE ----------
Release Regression From : 1.3.1_03
The above release value was the last known release where this
bug was known to work. Since then there has been a regression.
(Review ID: 158336)
======================================================================
- relates to
-
JDK-4500684 JCK1.4,JCK1.3a interactive:api/javax_swing/interactive/JButtonTests.html#JButton
-
- Closed
-
-
JDK-4455060 No response from VK_PRINTSCREEN
-
- Closed
-