Documente Academic
Documente Profesional
Documente Cultură
Layouts
Events &
Listeners
Components size
and position can
be define by
developers
PAGE_START
PAGE_END
LINE_START
LINE_END
CENTER
AGridLayoutobject places
components in a grid of cells.
Each component takes all the
available space within its cell,
and each cell is exactly the
same size.
This options is
available for
containers and
windows
components
Null Layout
GridBag Layout
Flow Layout
Box Layout
Events are
objects!
Instantiate a
listener
Register the
listener
Anonymous
Inner class
Outer class
Member
Inner class
Listener Listen to
Component changes in the component's size, position, or visibility.
Focus whether the component gained or lost the keyboard
focus.
Key key presses; key events are fired only by the component
that has the current keyboard focus.
Mouse mouse clicks, mouse presses, mouse releases and
mouse movement into or out of the component's drawing
area.
Mouse-Motion changes in the mouse cursor's position over the
component.
Mouse-Wheel mouse wheel movement over the component.
Hierarchy changes to a component's containment hierarchy of
changed events.
Hierarchy Bounds changes to a component's containment hierarchy of moved
and resized events.
Component
Available
events for
the
component
Substance Insubstantial
Insubstantial WebPage
Insubstantial WebPage
1. We need to keep
the old text UI
working
2. We need to
develop a new GUI
Interface methods
implementation
Event handling
methods
Received
arguments
are used for
executing
required UI
We send
arguments in
the program
execution
We send
arguments in
the program
execution
[Barker] J. Barker, Beginning Java Objects: From Concepts To Code, Second Edition,
Apress, 2005.
[Deitel] H.M. Deitel and P.J. Deitel, Java How to Program: Early Objects Version,
Prentice Hall, 2009.