Class WindowUtils


  • public class WindowUtils
    extends Object
    • Constructor Detail

      • WindowUtils

        public WindowUtils()
    • Method Detail

      • bringWindowToFront

        public static void bringWindowToFront​(Window window)
        Brings the provided window to the front.
        Parameters:
        window - the window instance to bring to front
      • sendToTheTop

        public static boolean sendToTheTop​(com.sun.jna.Pointer pointer)
        Move the window to the top of the z-order.
        Parameters:
        pointer - The pointer to the window to bring into background.
        Returns:
        true if successful.
      • sendToTheTopWin32

        public static boolean sendToTheTopWin32​(com.sun.jna.Pointer pointer)
        Move the window to the top of the z-order.
        Parameters:
        pointer - The pointer to the window to bring into background.
        Returns:
        true if the window could placed set on top.
      • isValidScreenLocation

        public static boolean isValidScreenLocation​(Rectangle location)
      • getMaximumScreenBounds

        public static Rectangle getMaximumScreenBounds()
      • getScreenInsets

        public static Insets getScreenInsets​(Window windowOrNull)
        getScreenInsets, This returns the insets of the screen, which are defined by any task bars that have been set up by the user. This function accounts for multi-monitor setups. If a window is supplied, then the the monitor that contains the window will be used. If a window is not supplied, then the primary monitor will be used.
      • getScreenWorkingArea

        public static Rectangle getScreenWorkingArea​(Window windowOrNull)
        getScreenWorkingArea, This returns the working area of the screen. (The working area excludes any task bars.) This function accounts for multi-monitor setups. If a window is supplied, then the the monitor that contains the window will be used. If a window is not supplied, then the primary monitor will be used.
      • getScreenTotalArea

        public static Rectangle getScreenTotalArea​(Window windowOrNull)
        getScreenTotalArea, This returns the total area of the screen. (The total area includes any task bars.) This function accounts for multi-monitor setups. If a window is supplied, then the the monitor that contains the window will be used. If a window is not supplied, then the primary monitor will be used.
      • centerOnCurrentScreen

        public static void centerOnCurrentScreen​(Component parent,
                                                 Component view)
        Center the view on the current screen of the parent component.
        Parameters:
        parent - the parent
        view - the view