Sources of Events
Table 24-2 lists some of the user interface components that can generate the events described in the previous section. In addition to these graphical user interface elements, any class derived from Component, such as Applet, can generate events. For example, you can receive key and mouse events from an applet. (You may also build your own components that generate events.) In this chapter, we will be handling only mouse and keyboard events, but the following two chapters will be handling events from the sources shown in Table 24-2.
Event Source : Description
Button : Generates action events when the button is pressed.
Check box : Generates item events when the check box is selected or deselected.
Choice : Generates item events when the choice is changed.
List : Generates action events when an item is double-clicked; generates item events when an item is selected or deselected.
Menu item : Generates action events when a menu item is selected; generates item events when a checkable menu item is selected or deselected.
Scroll bar : Generates adjustment events when the scroll bar is manipulated.
Text components : Generates text events when the user enters a character.
Window : Generates window events when a window is activated, closed, deactivated, deiconified, iconified, opened, or quit.
Table 24-2 Event Source Examples
Copyright © 2018-2020 BrainKart.com; All Rights Reserved. Developed by Therithal info, Chennai.