JDK-6532705 : Parent frame appears above a FileDialog
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 1.4.2,7,11,12,15,16,17,18
  • Priority: P4
  • Status: Open
  • Resolution: Unresolved
  • OS: windows_xp
  • CPU: x86
  • Submitted: 2007-03-09
  • Updated: 2022-07-12
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
tbdUnresolved
Related Reports
Relates :  
Relates :  
Description
This is reproducable on Windows platform, with 6.0 and 7.

I've a FileDialog having a Frame as owner. When frame.setVisible(true) is called when both the FileDialog and the frame is visible, frame appears above the FileDialog. This happens only when setModal(false) is explicitly called on the FileDialog

To reproduce:
Run the attached test - it will display and Frame and a child FileDialog. Wait for 5 seconds for the setVisible(true) to be called on the frame. If the frame comes above the FileDialog, bug is reproduced


import java.awt.*;

public class Test {
    
    public static void main(String[] args) {
        Frame f = new Frame();
        f.setSize(200, 200);
        f.setVisible(true);
        FileDialog fd = new FileDialog(f);
        fd.setModal(false);
        fd.setVisible(true);
        
        try { Thread.sleep(5000); } catch (Exception e) {}
        
        f.setVisible(true);
    }
}

Comments
Observed same issue with jdk18b27 on Windows 11 x64.
28-12-2021

Test build: JDK11b23(CC-build(http://slc07hab.us.oracle.com/jdk_coverage/builds/11_23/jdk-11-instr_linux-x64_bin.tar.gz )) Platform :ubuntu18.04-x64 ute tool: tonga-4.0.2-rc2.jar Test case:AWT_Modality/Automated/setVisible/FileDialog/NonModal The case failed as the same issue refer to the log: http://sc11152645.us.oracle.com:8080/evergreen/results/11/b23/awt-cc/auto/ubuntu18.04-x64/results-awt-run1/ResultDir/NonModal/NonModal.log
07-08-2018

- this is an issue reported against 7(7u), - there are now affected version 9 filed for this issue - 7u issues are transferred to Sustaining Nevertheless if someone have a report against 9 - please reopen and add affectedVersion 9 or 7u specific escalations might be reopen to Sustaining
10-08-2014

- this is an issue reported against 7(7u), - there are now affected version 9 filed for this issue - 7u issues are transferred to Sustaining Nevertheless if someone have a report against 9 - please reopen and add affectedVersion 9 or 7u specific escalations might be reopen to Sustaining
10-08-2014

The fix can be as simple as to use the real owner, if the file dialog is modeless.
17-03-2014

EVALUATION After the AWT modality improvements in JDK 6.0, the native parent for a file dialog was changed from AWT parent to AWT toolkit window to disable Win32 native modality. This worked almost fine (with some bugs, however), but for modeless file/print/page dialogs this leads to the problem described in this CR.
09-03-2007