import javafx.application.Application; import javafx.geometry.Dimension2D; import javafx.scene.ImageCursor; import javafx.stage.Stage; /** * * @author vakulova */ public class Test extends Application { public static void main(String[] args) { launch(args); } @Override public void start(Stage stage) throws Exception { Dimension2D dim = ImageCursor.getBestSize(20, 20); Dimension2D dim1 = ImageCursor.getBestSize(300, 300); System.out.println("BestSize (20, 20): " + dim.getWidth() + ", " + dim.getHeight() + "\nBestSize (300, 300): " + dim1.getWidth() + ", " + dim1.getHeight()); return; } }