Java examples for JavaFX:Rectangle
get JavaFX Screen Dimensions
//package com.java2s; import javafx.geometry.Rectangle2D; import javafx.stage.Screen; import java.util.HashMap; public class Main { public static HashMap<String, Double> getScreenDimensions() { HashMap<String, Double> screenDimensions = new HashMap<>(); Rectangle2D screenBounds = Screen.getPrimary().getVisualBounds(); screenDimensions.put("width", screenBounds.getWidth()); screenDimensions.put("height", screenBounds.getHeight()); return screenDimensions; }/* w w w. j a va2 s.com*/ }