Java tutorial
//package com.java2s; //License from project: Open Source License import java.awt.Dimension; import javafx.geometry.Bounds; import javafx.scene.Node; public class Main { /** * Returns the dimensions of the component's layout bounds * @param pFxComponent * @return */ public static Dimension getDimensionOfComponent(final Node pFxComponent) { return convertToDimension(pFxComponent.getLayoutBounds()); } /** * Converts a Bound to a Dimension. Note that some information will be * lost (depth, x, y, etc) yet the width and height will be preserved * @param pBound * @return */ public static Dimension convertToDimension(Bounds pBound) { Dimension result = new Dimension(); result.setSize(pBound.getWidth(), pBound.getHeight()); return result; } }