Class GraphicsEnvironment


  • public final class GraphicsEnvironment
    extends Object
    GraphicsEnvironment is a utility class to provide different informations about the graphics environment.
    • Constructor Detail

      • GraphicsEnvironment

        public GraphicsEnvironment()
    • Method Detail

      • getScreenResolution

        public static final int getScreenResolution()
        Returns the screen resolution in dots-per-inch. Therefore Toolkit.getScreenResolution() is used. If the graphics environment is headless, a default value of 72 will be returned. If a user-defined resolution has been set to a positive value via setUserDefinedScreenResolution(int), this value will be used instead.
        Returns:
        this toolkit's screen resolution in dots-per-inch, a user-defined resolution or in headless mode 72 as default value.
      • setUserDefinedScreenResolution

        public static final void setUserDefinedScreenResolution​(int resolution)
        Set a user-defined resolution in dots-per-inch to be used for all sizing-calculations instead of the resolution returned from Toolkit.getScreenResolution(). If set to zero or a negative value, the default resolution as provided by Toolkit.getScreenResolution() will be used.
      • getSystemClipboard

        public static final Clipboard getSystemClipboard()
        Gets the system clipboard which interfaces with clipboard facilities provided by the native platform. In contrast to calling Toolkit.getSystemClipboard() this method will not throw an exception if GraphicsEnvironment.isHeadless().
        Returns:
        the system clipboard
      • isSystemClipboardAccessible

        public static final boolean isSystemClipboardAccessible()
        Returns an indicator whether system clipboard is accessible.
        Returns:
        boolean accessibility
      • getGraphicsConfiguration

        public static final GraphicsConfiguration getGraphicsConfiguration​(Point point)
        Returns the GraphicsConfiguration object which belongs to the given point. If the given point is null the GraphicsConfiguration of the default screen will be returned.
        Parameters:
        point - look up point
        Returns:
        the GraphicsConfiguration object which belongs to the given or null if the point is null