- 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 theScreenobjects are relative to theScreen.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
 
- 
- 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object obj)Indicates whether some other object is "equal to" this one.Rectangle2DgetBounds()Gets the bounds of thisScreen.doublegetDpi()Gets the resolution (dots per inch) of thisScreen.doublegetOutputScaleX()Gets the recommended output scale factor of thisScreenin the horizontal (X) direction.doublegetOutputScaleY()Gets the recommended output scale factor of thisScreenin the vertical (Y) direction.static ScreengetPrimary()The primaryScreen.static ObservableList<Screen>getScreens()The observable list of currently availableScreens.static ObservableList<Screen>getScreensForRectangle(double x, double y, double width, double height)Returns a ObservableList ofScreensthat intersects the provided rectangle.static ObservableList<Screen>getScreensForRectangle(Rectangle2D r)Returns a ObservableList ofScreensthat intersects the provided rectangle.Rectangle2DgetVisualBounds()Gets the visual bounds of thisScreen.inthashCode()Returns a hash code for thisScreenobject.StringtoString()Returns a string representation of thisScreenobject.
 
- 
- 
- 
Method Detail- 
getPrimarypublic static Screen getPrimary() The primaryScreen.- Returns:
- the primary screen
 
 - 
getScreenspublic static ObservableList<Screen> getScreens() The observable list of currently availableScreens.- Returns:
- observable list of currently available screens
 
 - 
getScreensForRectanglepublic static ObservableList<Screen> getScreensForRectangle(double x, double y, double width, double height) Returns a ObservableList ofScreensthat intersects the provided rectangle.- Parameters:
- x- the x coordinate of the upper-left corner of the specified rectangular area
- y- the y coordinate of the upper-left corner of the specified rectangular area
- width- the width of the specified rectangular area
- height- the height of the specified rectangular area
- Returns:
- a ObservableList of Screensfor whichScreen.boundsintersects the provided rectangle
 
 - 
getScreensForRectanglepublic static ObservableList<Screen> getScreensForRectangle(Rectangle2D r) Returns a ObservableList ofScreensthat intersects the provided rectangle.- Parameters:
- r- The specified- Rectangle2D
- Returns:
- a ObservableList of Screensfor whichScreen.boundsintersects the provided rectangle
 
 - 
getBoundspublic final Rectangle2D getBounds() Gets the bounds of thisScreen. The bounds will be reported adjusted for theoutputScaleso that resizing aWindowwith these bounds and the sameoutputScaleas thisScreenwill cover the entire screen.- Returns:
- The bounds of this Screen
 
 - 
getVisualBoundspublic final Rectangle2D getVisualBounds() Gets the visual bounds of thisScreen. These bounds account for objects in the native windowing system such as task bars and menu bars. These bounds are contained byScreen.bounds.- Returns:
- The visual bounds of this Screen
 
 - 
getDpipublic final double getDpi() Gets the resolution (dots per inch) of thisScreen.- Returns:
- The resolution of this Screen
 
 - 
getOutputScaleXpublic final double getOutputScaleX() Gets the recommended output scale factor of thisScreenin the horizontal (X) direction. This scale factor should be applied to a scene in order to compensate for the resolution and viewing distance of the output device. The visual bounds will be reported relative to this scale factor.- Returns:
- the recommended output scale factor for the screen.
- Since:
- 9
 
 - 
getOutputScaleYpublic final double getOutputScaleY() Gets the recommended output scale factor of thisScreenin the vertical (Y) direction. This scale factor will be applied to the scene in order to compensate for the resolution and viewing distance of the output device. The visual bounds will be reported relative to this scale factor.- Returns:
- the recommended output scale factor for the screen.
- Since:
- 9
 
 - 
hashCodepublic int hashCode() Returns a hash code for thisScreenobject.- Overrides:
- hashCodein class- Object
- Returns:
- a hash code for this Screenobject.
- See Also:
- Object.equals(java.lang.Object),- System.identityHashCode(java.lang.Object)
 
 - 
equalspublic boolean equals(Object obj) Indicates whether some other object is "equal to" this one.- Overrides:
- equalsin class- Object
- Parameters:
- obj- the reference object with which to compare.
- Returns:
- trueif this object is equal to the- objargument;- falseotherwise.
- See Also:
- Object.hashCode(),- HashMap
 
 
- 
 
-