Package javafx.stage

Class Screen

java.lang.Object
javafx.stage.Screen

public final class Screen extends Object
Describes the characteristics of a graphics destination such as monitor. In a virtual device multi-screen environment in which the desktop area could span multiple physical screen devices, the bounds of the Screen objects are relative to the Screen.primary.

For example:


 Rectangle2D primaryScreenBounds = Screen.getPrimary().getVisualBounds();

 //set Stage boundaries to visible bounds of the main screen
 stage.setX(primaryScreenBounds.getMinX());
 stage.setY(primaryScreenBounds.getMinY());
 stage.setWidth(primaryScreenBounds.getWidth());
 stage.setHeight(primaryScreenBounds.getHeight());

 stage.show();
 
Since:
JavaFX 2.0