ADDITIONAL SYSTEM INFORMATION :
Windows 10, jdk8u151
A DESCRIPTION OF THE PROBLEM :
until jre1.8.0_151 circumflex dead key was "deactivated" after the action associated with circumflex key was enabled is UI.
after jre1.8.0_152 circumflex dead key stay "active" for the same application
REGRESSION : Last worked in version 8
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Compile and run with jdk8u151 - to check expected behavior.
Enable German keyboard layout. Start the program given in the souce code. Press dead circumflex key aka (^) on qwertz or (~) on qwerty keyboard.
New window called "popup" will open. Then click on textfield and press "a" key.
Compile and run with jdk8u152 to check how the behavior has been changed with jdk8u152 release comparing to jdku151.
Is very important to use valid java version during compilation and execution process, otherwise the reproduction process is not possible.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
TextField shows: a (works until jre1.8.0_151)
ACTUAL -
TextField shows: รข (on jre1.8.0_152)
---------- BEGIN SOURCE ----------
---------- BEGIN SOURCE ----------
import java.awt.BorderLayout;
import java.awt.EventQueue;
import java.awt.event.ActionEvent;
import java.awt.event.KeyEvent;
import javax.swing.AbstractAction;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JTextField;
import javax.swing.KeyStroke;
public class Demo
{
public void buildGui(){
JFrame frame = new JFrame("key buttons");
JPanel panel = new JPanel(new BorderLayout());
JButton a = new JButton("Open popup");
panel.add(a, BorderLayout.CENTER);
frame.setContentPane(panel);
frame.setVisible(true);
frame.pack();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setFocusTraversalKeysEnabled(false);
KeyStroke us = KeyStroke.getKeyStroke(KeyEvent.VK_DEAD_CIRCUMFLEX, 0, false);
panel.getInputMap().put(us, "A");
panel.getActionMap().put("A", new AbstractAction(){
@Override
public void actionPerformed(ActionEvent evt){
openWindow();
}
});
}
private void openWindow(){
JFrame frame = new JFrame("Popup");
JPanel panel = new JPanel(new BorderLayout());
JTextField textField = new JTextField(30);
panel.add(textField, BorderLayout.CENTER);
frame.setContentPane(panel);
frame.setVisible(true);
frame.pack();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
public static void main(String[] args){
EventQueue.invokeLater( new Demo()::buildGui);
}
}
---------- END SOURCE ----------
---------- END SOURCE ----------
FREQUENCY : always