Java Reference
In-Depth Information
Scrollbar
AdjustmentEvent
A
Scrollbar
provides a convenient option to
select a value from a given range. An
AdjustmentEvent
is fired if the value of the
Scrollbar
component is adjusted.
TextComponent
TextEvent
The
TextComponent
class is the superclass of
any component that allows text input. A
TextEvent
is fired if text in a
Component
derived from
TextComponent
is changed.
TextArea
None The
TextArea
is a component capable of
displaying a multiline region of text. If the text
inside the
TextArea
changes, a
TextEvent
is
fired.
TextField
ActionEvent
The
TextField
is a component allowing the user
to edit a single line of text. If the text inside the
TextField
changes, a
TextEvent
is fired. An
ActionEvent
is fired if the text is confirmed by a
return keystroke.
Table
4
.2. Available AWT Event
s
and Corresponding Listeners
Event Name
L
istener
Description and Interface Methods
ActionEvent
ActionListener
Invoked by a specific component to indicate that a
component-specific action occurred. Classes
implementing an
ActionListener
in order to
receive
ActionEvents
need to implement the
following method:
void actionPerformed(ActionEvent
e
)
AdjustmentEvent AdjustmentListener
Invoked by components indicating that their value
has been adjusted. Classes implementing an
AdjustmentListener
in order to receive
AdjustmentEvent
s need to implement the
following method:
void adjustmentValueChanged
(AdjustmentEvent e)
ComponentEvent
ComponentListener
Invoked by componentes in order to indicate
that a component has moved, changed its
s
ize or changed its visibility.
ContainerEvent
ContainerListener
Invoked in order to indicate that a component
h
as beed added or removed.
FocusEvent
FocusListener
Invoked by components in order to indicate that
they have gained or lost the keyboard focus.
Classes implementing a
FocusListener
in
order to receive
FocusEvents
need to
implement the following methods:
void focusGained(FocusEvent e)
v
oid focusLost(FocusEvent e)
ItemEvent
ItemListener
Invoked by
ItemSelectable
components in
order to indicate that an item is selected or
deselected. Classes implementing an
ItemListener
in order to receive
I
temEvent
s need to implement the following
Search WWH ::
Custom Search