JDK-6532709 : FileDialog appears at wrong location
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 7
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_xp
  • CPU: x86
  • Submitted: 2007-03-09
  • Updated: 2011-05-30
  • Resolved: 2011-05-30
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.
JDK 8
8Resolved
Related Reports
Duplicate :  
Relates :  
Description
This is reproducable on Windows with jdk 7.

A FileDialog having a non-null owner is displayed a bit off from (0,0), where as a FileDialog with null owner is shown at (0,0). With 6.0, a FileDialog created with null/non-null owner appears at (0, 0).

To reproduce:
Run the below test. If the FileDialog does not appear at (0,0), bug is reproduced

import java.awt.FileDialog;
import java.awt.Frame;

public class Test { 
    public static void main(String[] args) {
        new FileDialog(new Frame()).setVisible(true);
    }
}

Comments
EVALUATION File dialogs are not located at (0, 0) after the fix for 6488834 into JDK 7.0-b04, however this is not a regression: in 1.5.0 behavior is the same as now. This happens because we create an invisible frame as a parent for dialog, it is located (by default) in (0, 0) and the dialog is placed (also, by default) a bit lower. At the same time, if we create a real frame as a parent for the file dialog, place it somewhere at the screen and then show the dialog - it is still not located at (0, 0) or right below the frame. This is different in 7.0-b04 and 1.5.0 and is easily understood: in the fix for 6488834 all the file dialogs with a Java parent have a toolkit window as a native owner. As the toolkit window is always placed at (0, 0) and have the same size as the dummy window from the test, the file dialog is always place right below it.
09-03-2007