JDK-8089897 : Utils.pointRelativeTo doesn't position window correctly when it is overlapping with existing one
  • Type: Bug
  • Component: javafx
  • Sub-Component: controls
  • Affected Version: 8
  • Priority: P4
  • Status: Open
  • Resolution: Unresolved
  • Submitted: 2013-04-29
  • Updated: 2018-09-05
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 :  
Description
I tried to use the following method to position CustomColorDialog relative to ColorPicker. 

public static Point2D pointRelativeTo(Object parent, double width,
            double height, double screenX, double screenY, HPos hpos, VPos vpos)

I specify:

screenX = colorPicker.getX() + colorPicker.getWidth()
screenY = colorPicker.getY()
hpos = HPos.RIGHT
vpos = VPos.CENTER

When there is enough space to the left or to the right from the colorPicker, window is positioned correctly.
Otherwise, it is positioned to the leftmost screen position. This doesn't seem to be correct. According to my hpos variable, I want it to be positioned to the right.

So I didn't use this method in my fix to RT-27001

Comments
CustomColorDialog portion of code that didn't work right: private void fixPosition() { Window w = dialog.getOwner(); Point2D xy = com.sun.javafx.Utils.pointRelativeTo(w, dialog.getWidth(), dialog.getHeight(), w.getX() + w.getWidth(), w.getY(), HPos.RIGHT, VPos.CENTER); dialog.setX(xy.getX()); dialog.setY(xy.getY()); }
29-04-2013