-
Bug
-
Resolution: Fixed
-
P3
-
8, 11, 17, 21, 22
-
b27
-
x86_64
-
windows
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8365049 | 21.0.10-oracle | Dmitry Markov | P3 | Resolved | Fixed | master |
JDK-8365123 | 17.0.18-oracle | Dmitry Markov | P3 | Resolved | Fixed | master |
JDK-8365167 | 11.0.30-oracle | Dmitry Markov | P3 | Resolved | Fixed | master |
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
- backported by
-
JDK-8365049 Keyboard layout didn't keep its state if it was changed when dialog was active
-
- Resolved
-
-
JDK-8365123 Keyboard layout didn't keep its state if it was changed when dialog was active
-
- Resolved
-
-
JDK-8365167 Keyboard layout didn't keep its state if it was changed when dialog was active
-
- Resolved
-
- relates to
-
JDK-8187635 On Windows Swing changes keyboard layout on a window activation
-
- Resolved
-
- links to
-
Commit(master) openjdk/jdk/2be07b5f
-
Review(master) openjdk/jdk/22411
(1 links to)