The problem was originally reported here:
http://forums.java.net/jive/thread.jspa?messageID=366737
THE PROBLEM:
Closing modal dialog doesn't activate its owner.
HOW TO REPRODUCE:
Compile and run the testcase below.
1. Two frames and one dialog will appear. Make sure the dialog is focused.
2. Alt-tab to the frame "f0".
3. Alt-Tab to the dialog again.
4. Close the dialog.
EXPECTED BEHAVIOR:
The frame "f1" (the owner of the dialog) gets activated.
ACTUAL BEHAVIOR:
The previously active frame "f0" gets activated.
Note that this works fine on Linux.
=======================================================================
import java.awt.*;
import javax.swing.*;
public class Test {
public static void main(String[] args) {
JFrame f0 = new JFrame("f0");
JFrame f1 = new JFrame("f1");
JDialog d = new JDialog(f1);
d.setModalityType(JDialog.ModalityType.DOCUMENT_MODAL);
f0.add(new JButton("frame0"));
f1.add(new JButton("frame1"));
d.add(new JButton("dialog"));
f1.setLocation(200, 0);
d.setLocation(0, 200);
f0.pack();
f1.pack();
d.pack();
f0.setVisible(true);
f1.setVisible(true);
d.setVisible(true);
}
}
=======================================================================