PopUpPositioningDemo.java 文件源码

java
阅读 23 收藏 0 点赞 0 评论 0

项目:javafx-demos 作者:
public void showPopupWithinBounds(final Node node, final Popup popup) {
    final Window window = node.getScene().getWindow();
    double x = window.getX() + node.localToScene(0, 0).getX() + node.getScene().getX();
    double y = window.getY() + node.localToScene(0, 0).getY() + node.getScene().getY() + node.getBoundsInParent().getHeight();
    popup.show(window, x, y);
    if (!popup.getContent().isEmpty()) {
        final Node content = popup.getContent().get(0);
        x -= content.localToScene(0, 0).getX();
        y -= content.localToScene(0, 0).getY();
    }
    Point2D pd= new Point2D(x, y);

    double Z = window.getX();
    double gX = sp.getLayoutX();
    double c = sp.getWidth()-popup.getWidth();

    popup.show(window, (Z+gX+c+8), y);
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号