# Class WindowEvent

java.lang.Object
com.codename1.ui.events.ActionEvent
com.codename1.ui.events.WindowEvent

public class WindowEvent extends ActionEvent
Describes a change in the native window hosting the Codename One display on desktop platforms.

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Class
  Description
  `static enum`
  `WindowEvent.Type`
  The type of window change that occurred.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `WindowEvent(Display source, WindowEvent.Type type, Rectangle bounds)`
  Creates a new window event instance.
  `WindowEvent(Object source, WindowEvent.Type type, Rectangle bounds)`
  Creates a new window event for a source other than the display, such as an individual `com.codename1.ui.Window`.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `Rectangle`
  `getBounds()`
  Returns the window bounds associated with this event.
  `WindowEvent.Type`
  `getType()`
  The type of window event.

  ### Methods inherited from class ActionEvent

  `consume, getActualComponent, getCommand, getComponent, getDraggedComponent, getDropTarget, getEventType, getKeyEvent, getPointerEvent, getProgress, getSource, getX, getY, isConsumed, isLongEvent, isPointerPressedDuringDrag, setPointerEvent, setPointerPressedDuringDrag`

  ### Methods inherited from class Object

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

- ## Constructor Details

  - ### WindowEvent

    public WindowEvent(Display source, WindowEvent.Type type, Rectangle bounds)

    Creates a new window event instance.

    ###### Parameters

    - `source`: the display that generated the event

    - `type`: the type of the window event

    - `bounds`: the bounds of the window, if known

  - ### WindowEvent

    public WindowEvent(Object source, WindowEvent.Type type, Rectangle bounds)

    Creates a new window event for a source other than the display, such as an individual `com.codename1.ui.Window`.

    The `Display` form is kept separate so that code registered through `Display#addWindowListener(com.codename1.ui.events.ActionListener)` -- which only ever hears about the application's main window -- can keep casting `getSource()` to `Display` safely.

    ###### Parameters

    - `source`: the object that generated the event

    - `type`: the type of the window event

    - `bounds`: the bounds of the window, if known

- ## Method Details

  - ### getType

    public WindowEvent.Type getType()

    The type of window event.

    ###### Returns

    the event type

  - ### getBounds

    public Rectangle getBounds()

    Returns the window bounds associated with this event.

    ###### Returns

    the window bounds or `null` if not provided