It seems to me the source of the problem is line 466 in com.sun.javafx.util.Utils:
//TODO - testing for an instance of Stage seems wrong but works for menus if (scene.getWindow() instanceof Stage) { layoutX = layoutX + parentBounds.getWidth() - anchorWidth; } else { layoutX = layoutX - parentBounds.getWidth() - anchorWidth; } As Popup is a Window but not a Stage, the proposed fix is to simply change the condition to: if (scene.getWindow() instanceof Window) Obviously tests need to be run to see this doesn't break anything else, but I'm not sure how to do so. As I can't post this to the JDK bug tracking system I'm sending this here, so I'll appreciate it is someone with access can post it there. If it does pass all tests, and considering it's a pretty simple change, I'd greatly appreciate if it could find its way into the next 8 update, as it is currently blocking a feature in a project I'm working on. Note: I'm not sure if I have used the most up-to-date dev version for the patch file. Also, the test itself may be redundant, as getWindow() should always return Window, shouldn't it? Regards, Itai.
--- Utils.java 2016-12-09 16:10:01.660349512 +0200 +++ Utils-new.java 2016-12-09 15:47:52.157662974 +0200 @@ -466,7 +466,7 @@ if (orientation == NodeOrientation.RIGHT_TO_LEFT && hpos == HPos.CENTER) { //TODO - testing for an instance of Stage seems wrong but works for menus - if (scene.getWindow() instanceof Stage) { + if (scene.getWindow() instanceof Window) { layoutX = layoutX + parentBounds.getWidth() - anchorWidth; } else { layoutX = layoutX - parentBounds.getWidth() - anchorWidth;