Enter full-screen mode, or return to windowed mode. The entered full-screen mode may be either exclusive or simulated. Exclusive mode is only available if
isFullScreenSupported
returns
true
.
Exclusive mode implies:
- Windows cannot overlap the full-screen window. All other application windows will always appear beneath the full-screen window in the Z-order.
- There can be only one full-screen window on a device at any time, so calling this method while there is an existing full-screen Window will cause the existing full-screen window to return to windowed mode.
- Input method windows are disabled. It is advisable to call
Component.enableInputMethods(false)
to make a component a non-client of the input method framework.
The simulated full-screen mode places and resizes the window to the maximum possible visible area of the screen. However, the native windowing system may modify the requested geometry-related data, so that the Window
object is placed and sized in a way that corresponds closely to the desktop settings.
When entering full-screen mode, if the window to be used as a full-screen window is not visible, this method will make it visible. It will remain visible when returning to windowed mode.
When entering full-screen mode, all the translucency effects are reset for the window. Its shape is set to null
, the opacity value is set to 1.0f, and the background color alpha is set to 255 (completely opaque). These values are not restored when returning to windowed mode.
It is unspecified and platform-dependent how decorated windows operate in full-screen mode. For this reason, it is recommended to turn off the decorations in a Frame
or Dialog
object by using the setUndecorated
method.
When returning to windowed mode from an exclusive full-screen window, any display changes made by calling setDisplayMode
are automatically restored to their original state.