The following bug was found when fixing 6302514 after assigning a null parent to print/pag dialogs, the null-parent dialogs are found to be unblocked. FileDialog and Print/Page Dialogs both uses Window peers and share modality-related code.
import java.awt.*;
import java.awt.event.*;
public class FileDialogTest {
public static void main(String[] args) {
final Dialog td = new Dialog((Frame) null, "Toolkit modal dialog",
Dialog.ModalityType.TOOLKIT_MODAL);
td.setLayout(new FlowLayout());^M
^M
Button printbtn2 = new Button("File Dialog");^M
^M
printbtn2.addActionListener(new ActionListener() {^M
public void actionPerformed(ActionEvent event) {^M
//FileDialog jd = new FileDialog(td, "FileDialog Test"); ^M
FileDialog jd = new FileDialog((Dialog)null, "FileDialog Test"); ^M
jd.show();^M
}^M
});^M
td.add(printbtn2);^M
td.setSize(250, 150);
td.setVisible(true);
}
}