-
Bug
-
Resolution: Not an Issue
-
P3
-
5.0u29, 6
-
generic
-
windows
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-2211325 | 5.0u29 | Nikolay Gorshkov | P4 | Closed | Not an Issue |
REGRESSION
----------
Since 1.5.0_29 and later
Since 1.6.0_12 and later
Also on all JDK 7 versions.
SYNOPSIS
--------
Regression: unexpected Z ordering of windows when returning from modal dialog
OPERATING SYSTEM
----------------
Windows
FULL JDK VERSION
----------------
JDK 1.5, 6, 7.
PROBLEM DESCRIPTION from LICENSEE
---------------------------------
The testcase starts with a single window (A) with a single button. When the button is pressed, another window appears (B). A modal option dialog is then created, with B as the parent. When an option is chosen and the modal dialog closes, we expect control to pass back to its parent - Window B. This is the case for 1.5.0_28 and earlier, and 1.6.0_11 and earlier.
In 1.5.0_29 and later, and 1.6.0_12 and later, and JDK 7, when we choose an option and the modal dialog closes, control passes back to Window A, and Window B is unexpectedly moved behind Window A. This doesn't seem to make any sense, and there doesn't seem to be a workaround. This change in behaviour affects the GUI of one of our products and there doesn't appear to be any workaround, other than manually moving windows around to find the parent of the modal dialog.
REPRODUCTION INSTRUCTIONS
-------------------------
1. Compile and run the attached testcase.
2. Click the "Start" button in Window A. Two windows will appear - Window B and a modal option dialog.
3. Click any button in the modal option dialog, to close it.
Expected behaviour (1.5.0_28 and earlier, 1.6.0_11 and earlier)
Control should pass back to the parent of the modal dialog, Window B.
Observed behaviour (1.5.0_29 and later, 1.6.0_12 and later, JDK 7)
Control passes back to Window A, and Window B is unexpectedly moved behind Window A.
TESTCASE
--------
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class FocusOrder {
static JFrame dialog;
public static void main(String[] args) {
JButton button = new JButton("Start");
button.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
createWindow();
}});
JFrame frame = new JFrame();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.getContentPane().setLayout(new BorderLayout());
frame.getContentPane().add(button, BorderLayout.SOUTH);
frame.setSize(500, 400);
frame.setVisible(true);
dialog = new JFrame();
dialog.setSize(300, 200);
dialog.toFront();
}
public static void createWindow() {
dialog.setVisible(true);
FocusManager.setCurrentManager(new DefaultFocusManager());
JOptionPane.showConfirmDialog(dialog, "Press any button");
}
}
----------
Since 1.5.0_29 and later
Since 1.6.0_12 and later
Also on all JDK 7 versions.
SYNOPSIS
--------
Regression: unexpected Z ordering of windows when returning from modal dialog
OPERATING SYSTEM
----------------
Windows
FULL JDK VERSION
----------------
JDK 1.5, 6, 7.
PROBLEM DESCRIPTION from LICENSEE
---------------------------------
The testcase starts with a single window (A) with a single button. When the button is pressed, another window appears (B). A modal option dialog is then created, with B as the parent. When an option is chosen and the modal dialog closes, we expect control to pass back to its parent - Window B. This is the case for 1.5.0_28 and earlier, and 1.6.0_11 and earlier.
In 1.5.0_29 and later, and 1.6.0_12 and later, and JDK 7, when we choose an option and the modal dialog closes, control passes back to Window A, and Window B is unexpectedly moved behind Window A. This doesn't seem to make any sense, and there doesn't seem to be a workaround. This change in behaviour affects the GUI of one of our products and there doesn't appear to be any workaround, other than manually moving windows around to find the parent of the modal dialog.
REPRODUCTION INSTRUCTIONS
-------------------------
1. Compile and run the attached testcase.
2. Click the "Start" button in Window A. Two windows will appear - Window B and a modal option dialog.
3. Click any button in the modal option dialog, to close it.
Expected behaviour (1.5.0_28 and earlier, 1.6.0_11 and earlier)
Control should pass back to the parent of the modal dialog, Window B.
Observed behaviour (1.5.0_29 and later, 1.6.0_12 and later, JDK 7)
Control passes back to Window A, and Window B is unexpectedly moved behind Window A.
TESTCASE
--------
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class FocusOrder {
static JFrame dialog;
public static void main(String[] args) {
JButton button = new JButton("Start");
button.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
createWindow();
}});
JFrame frame = new JFrame();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.getContentPane().setLayout(new BorderLayout());
frame.getContentPane().add(button, BorderLayout.SOUTH);
frame.setSize(500, 400);
frame.setVisible(true);
dialog = new JFrame();
dialog.setSize(300, 200);
dialog.toFront();
}
public static void createWindow() {
dialog.setVisible(true);
FocusManager.setCurrentManager(new DefaultFocusManager());
JOptionPane.showConfirmDialog(dialog, "Press any button");
}
}
- backported by
-
JDK-2211325 Regression: unexpected Z ordering of windows when returning from modal dialog
-
- Closed
-