JDK-8069154 : [macosx] Modal JDialog moves from position in secondary monitor to primary monitor
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 8,9
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • OS: os_x
  • CPU: x86
  • Submitted: 2015-01-15
  • Updated: 2016-02-02
  • Resolved: 2016-02-02
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 9
9Resolved
Related Reports
Duplicate :  
Description
FULL PRODUCT VERSION :
java version "1.8.0_25"
Java(TM) SE Runtime Environment (build 1.8.0_25-b17)
Java HotSpot(TM) 64-Bit Server VM (build 25.25-b02, mixed mode)

ADDITIONAL OS VERSION INFORMATION :
Mac OS X 10.10.1 (14B25)

EXTRA RELEVANT SYSTEM CONFIGURATION :
Mac Pro with 2 Apple monitors

A DESCRIPTION OF THE PROBLEM :
I first noticed this bug when I upgraded to JDK 8, but thought at first it was a NetBeans issue. It is not. All Swing applications display this behavior.

Any modal dialog that is moved to the secondary display will jump to the same X and Y coordinates on the primary display the next time it is clicked on.

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
import java.awt.EventQueue;
import javax.swing.JDialog;
import javax.swing.JFrame;
import javax.swing.JLabel;

public class JavaApplication10
{
  public static void main(String[] args)
  {
    EventQueue.invokeLater(() ->
    {
      JFrame mainFrame = new JFrame("Main Frame");
      mainFrame.setSize(640, 480);
      mainFrame.setVisible(true);

      JDialog dlg = new JDialog(mainFrame, "Dialog");
      dlg.getContentPane().add(new JLabel("I'm a dialog"));
      dlg.setSize(480, 320);
      dlg.setVisible(true);
    });
  }

}


Run the above program on a dual monitor OS X setup. Move the dialog to the second monitor. Click on the main frame window. Then click on the dialog. Notice that the dialog will jump to the main monitor.

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
The dialog should stay where it is on the second monitor

REPRODUCIBILITY :
This bug can be reproduced always.


Comments
This is exact duplicate of JDK-8080729.
02-02-2016