ScreenSleepListener (Java SE 15 & JDK 15)
Description: declaration: module: java.desktop, package: java.awt.desktop, interface: ScreenSleepListener
Keywords: java.awt.desktop.ScreenSleepListener interface

Module java.desktop
Package java.awt.desktop

# Interface ScreenSleepListener

All Superinterfaces:
  `EventListener`, `SystemEventListener`

    public interface ScreenSleepListener
    extends SystemEventListener

Implementors receive notification when the displays attached to the system have entered power save sleep.

This notification is useful for discontinuing a costly animation, or indicating that the user is no longer present on a network service.

Since:
  9

- ## Method Summary

  Modifier and Type | Method | Description
  --- | --- | ---
  `void` | `screenAboutToSleep​(ScreenSleepEvent e)` | Called when the system displays have entered power save sleep.
  `void` | `screenAwoke​(ScreenSleepEvent e)` | Called when the system displays have awoken from power save sleep.

- ## Method Details

  - ### screenAboutToSleep

    void screenAboutToSleep​(ScreenSleepEvent e)
    Called when the system displays have entered power save sleep.
    Parameters:
      `e` - the screen sleep event

  - ### screenAwoke

    void screenAwoke​(ScreenSleepEvent e)
    Called when the system displays have awoken from power save sleep.
    Parameters:
      `e` - the screen sleep event