-
Bug
-
Resolution: Unresolved
-
P3
-
8, 11, 17, 21, 22
-
x86_64
-
windows
A DESCRIPTION OF THE PROBLEM :
Similar problem withJDK-8187635, but different scenario. In this case, keyboard layout is changed when a dialog is active. After the dialog is closed, the keyboard layout will revert to previous layout.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
- Run sample code.
- Click one of the button, a dialog will appear.
- Change keyboard layout (i.e from English to Russia).
- Close the dialog, and keyboard layout will revert to English.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Keyboard layout keep its state.
ACTUAL -
Keyboard layout revert to previous before it was changed.
---------- BEGIN SOURCE ----------
public static void main(String[] args) {
SwingUtilities.invokeLater(() -> {
JFrame jFrame = new JFrame("Test");
JDialog dialog = new JDialog(jFrame, "dialog", true);
dialog.setSize(new Dimension(100,100));
JButton button1 = new JButton();
button1.setText("dialog");
button1.addActionListener(e -> dialog.setVisible(true));
JButton button2 = new JButton();
button2.setText("option");
button2.addActionListener(e -> JOptionPane.showMessageDialog(jFrame, "optionPane"));
JPanel panel = new JPanel();
panel.add(button1);
panel.add(button2);
jFrame.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
jFrame.add(panel);
jFrame.setSize(new Dimension(300, 100));
jFrame.setVisible(true);
});
}
---------- END SOURCE ----------
FREQUENCY : always
Similar problem with
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
- Run sample code.
- Click one of the button, a dialog will appear.
- Change keyboard layout (i.e from English to Russia).
- Close the dialog, and keyboard layout will revert to English.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Keyboard layout keep its state.
ACTUAL -
Keyboard layout revert to previous before it was changed.
---------- BEGIN SOURCE ----------
public static void main(String[] args) {
SwingUtilities.invokeLater(() -> {
JFrame jFrame = new JFrame("Test");
JDialog dialog = new JDialog(jFrame, "dialog", true);
dialog.setSize(new Dimension(100,100));
JButton button1 = new JButton();
button1.setText("dialog");
button1.addActionListener(e -> dialog.setVisible(true));
JButton button2 = new JButton();
button2.setText("option");
button2.addActionListener(e -> JOptionPane.showMessageDialog(jFrame, "optionPane"));
JPanel panel = new JPanel();
panel.add(button1);
panel.add(button2);
jFrame.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
jFrame.add(panel);
jFrame.setSize(new Dimension(300, 100));
jFrame.setVisible(true);
});
}
---------- END SOURCE ----------
FREQUENCY : always
- relates to
-
JDK-8187635 On Windows Swing changes keyboard layout on a window activation
- Resolved