Top Description Inners Fields Constructors Methods
java.awt.desktop

public final Class UserSessionEvent

extends AppEvent
Class Inheritance
Imports
java.awt.Desktop, .GraphicsEnvironment, .HeadlessException, java.io.Serial

Event sent when the user session has been changed. Some systems may provide a reason of a user session change.
Since
9
See Also
UserSessionListener#userSessionActivated(UserSessionEvent), UserSessionListener#userSessionDeactivated(UserSessionEvent)

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static enum
UserSessionEvent.Reason

Kinds of available reasons of user session change.

Field Summary

Modifier and TypeField and Description
private final UserSessionEvent.Reason
reason

The reason of the user session change.

private static final long
serialVersionUID

Hides java.awt.desktop.AppEvent.serialVersionUID.

Use serialVersionUID from JDK 9 for interoperability.

Constructor Summary

AccessConstructor and Description
public
UserSessionEvent(UserSessionEvent.Reason
the reason of the user session change
reason
)

Constructs a UserSessionEvent.

Method Summary

Modifier and TypeMethod and Description
public UserSessionEvent.Reason

Returns:

reason a reason
getReason
()

Gets a reason of the user session change.

Field Detail

reasonback to summary
private final UserSessionEvent.Reason reason

The reason of the user session change.

serialVersionUIDback to summary
private static final long serialVersionUID

Hides java.awt.desktop.AppEvent.serialVersionUID.

Use serialVersionUID from JDK 9 for interoperability.

Annotations
@Serial

Constructor Detail

UserSessionEventback to summary
public UserSessionEvent(UserSessionEvent.Reason reason)

Constructs a UserSessionEvent.

Parameters
reason:UserSessionEvent.Reason

the reason of the user session change

Exceptions
HeadlessException:
if GraphicsEnvironment#isHeadless() returns true
UnsupportedOperationException:
if Desktop API is not supported on the current platform
See Also
Desktop#isDesktopSupported(), java.awt.GraphicsEnvironment#isHeadless

Method Detail

getReasonback to summary
public UserSessionEvent.Reason getReason()

Gets a reason of the user session change.

Returns:UserSessionEvent.Reason

reason a reason

See Also
Reason#UNSPECIFIED, Reason#CONSOLE, Reason#REMOTE, Reason#LOCK
java.awt.desktop back to summary

public final Enum UserSessionEvent.Reason

extends Enum<UserSessionEvent.Reason>
Class Inheritance

Kinds of available reasons of user session change.

Field Summary

Modifier and TypeField and Description
public static final UserSessionEvent.Reason
CONSOLE

The session was connected/disconnected to the console terminal.

public static final UserSessionEvent.Reason
LOCK

The session has been locked/unlocked.

public static final UserSessionEvent.Reason
REMOTE

The session was connected/disconnected to the remote terminal.

public static final UserSessionEvent.Reason
UNSPECIFIED

The system does not provide a reason for a session change.

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static UserSessionEvent.Reason
public static UserSessionEvent.Reason[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

CONSOLEback to summary
public static final UserSessionEvent.Reason CONSOLE

The session was connected/disconnected to the console terminal.

LOCKback to summary
public static final UserSessionEvent.Reason LOCK

The session has been locked/unlocked.

REMOTEback to summary
public static final UserSessionEvent.Reason REMOTE

The session was connected/disconnected to the remote terminal.

UNSPECIFIEDback to summary
public static final UserSessionEvent.Reason UNSPECIFIED

The system does not provide a reason for a session change.

Constructor Detail

Reasonback to summary
private Reason()

Method Detail

valueOfback to summary
public static UserSessionEvent.Reason valueOf(String name)
valuesback to summary
public static UserSessionEvent.Reason[] values()