Package org.jdesktop.application.utils

# Class SwingHelper

java.lang.Object
org.jdesktop.application.utils.SwingHelper

public final class SwingHelper extends Object
Utility class for Swing Application Framework (BSAF)

Since:
  1.9
Author:
  Illya Yalovyy, Eric Heumann

## Method Summary

Modifier and Type
Method
Description
`static Rectangle`
`computeVirtualGraphicsBounds()`
Calculates virtual graphic bounds.
`static Point`
`defaultLocation(Window window)`
Calculates default location for the specified window.
`static RootPaneContainer`
`findRootPaneContainer(Component root)`
Finds the nearest RootPaneContainer of the provided Component.
`static Rectangle`
`getWindowNormalBounds(Window window)`
Gets `Window` bounds from the client property
`static boolean`
`isResizable(Window window)`
Checks whether the window supports resizing
`static void`
`putWindowNormalBounds(Window window, Rectangle bounds)`
Puts `Window` bounds to client property.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Method Details

### computeVirtualGraphicsBounds

public static Rectangle computeVirtualGraphicsBounds()
Calculates virtual graphic bounds. On multiscreen systems all screens are united into one virtual screen.

Returns:
  the graphic bounds

### isResizable

public static boolean isResizable(Window window)
Checks whether the window supports resizing

Parameters:
  `window` - the `Window` to be checked
Returns:
  true if the window supports resizing

### defaultLocation

public static Point defaultLocation(Window window)
Calculates default location for the specified window.

Parameters:
  `window` - the window location is calculated for. It should not be null.
Returns:
  default location for the window

### findRootPaneContainer

public static RootPaneContainer findRootPaneContainer(Component root)
Finds the nearest RootPaneContainer of the provided Component. Primarily, if a JPopupMenu (such as used by JMenus when they are visible) has no parent, the search continues with the JPopupMenu's invoker instead. Fixes BSAF-77

Parameters:
  `root` - the Component
Returns:
  a RootPaneContainer for the provided component

### getWindowNormalBounds

public static Rectangle getWindowNormalBounds(Window window)
Gets `Window` bounds from the client property

Parameters:
  `window` - the source `Window`
Returns:
  bounds from the client property

### putWindowNormalBounds

public static void putWindowNormalBounds(Window window, Rectangle bounds)
Puts `Window` bounds to client property.

Parameters:
  `window` - the target `Window`
  `bounds` - bounds