public class WindowEvent

  1. Object
  2. ActionEvent
  3. WindowEvent
Describes a change in the native window hosting the Codename One display on desktop platforms.

Nested types

enum WindowEvent.TypeThe type of window change that occurred.

Constructors

public WindowEvent(Display source, WindowEvent.Type type, Rectangle bounds)Creates a new window event instance.
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.

Methods

public WindowEvent.Type getType()The type of window event.
public Rectangle getBounds()Returns the window bounds associated with this event.

Inherited methods

Constructor details

WindowEvent

public WindowEvent(Display source, WindowEvent.Type type, Rectangle bounds)
Creates a new window event instance.

Parameters

source Display
the display that generated the event
type WindowEvent.Type
the type of the window event
bounds Rectangle
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 Object
the object that generated the event
type WindowEvent.Type
the type of the window event
bounds Rectangle
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