-
Bug
-
Resolution: Fixed
-
P4
-
7
-
b55
-
generic
-
generic
-
Verified
Sometimes it's possible that modal dialog still blocks the calling thread (the thread it was shown on) even after it's been disposed. Here is the short testcase that demonstrates the problem:
import java.awt.*;
import java.awt.event.*;
public class TestModalDialog {
public static void main(String[] args) {
Frame f = new Frame();
f.setSize(400, 300);
f.setVisible(true);
final Dialog d = new Dialog(f);
Button b = new Button("Test");
d.add(b);
b.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent ev) {
d.setVisible(false);
d.dispose();
}
});
d.setSize(200, 100);
d.setModal(true);
d.setVisible(true);
System.err.println("dialog closed");
f.dispose();
}
}
import java.awt.*;
import java.awt.event.*;
public class TestModalDialog {
public static void main(String[] args) {
Frame f = new Frame();
f.setSize(400, 300);
f.setVisible(true);
final Dialog d = new Dialog(f);
Button b = new Button("Test");
d.add(b);
b.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent ev) {
d.setVisible(false);
d.dispose();
}
});
d.setSize(200, 100);
d.setModal(true);
d.setVisible(true);
System.err.println("dialog closed");
f.dispose();
}
}