Java Reference
In-Depth Information
cut and paste or interprocess communication. Cut and paste is a
user-initiated data transfer in which the user copies data from one
application into a transfer buffer (often called a Ȓclipboardȓ) managed by the
operating system and inserts the buffer's contents into another application.
Interprocess communication is initiated by applications that transfer data
without direct user involvement.
ȗ Networking. The operating system provides protocols and services for
enabling applications to reach information on other computers attached to
the network.
Today, the most popular operating systems for personal computers are Linux (see
figure), the Macintosh OS, and Microsoft Windows.
407
408
9.6 Events, Event Sources, and Event Listeners
In the applications that you have written so far, user input was under control of the
program. The program asked the user for input in a specific order. For example, a
program might ask the user to supply first a name, then a dollar amount. But the
programs that you use every day on your computer don't work like that. In a program
with a modern graphical user interface, the user is in control. The user can use both
the mouse and the keyboard and can manipulate many parts of the user interface in
any desired order. For example, the user can enter information into text fields, pull
down menus, click buttons, and drag scroll bars in any order. The program must react
to the user commands, in whatever order they arrive. Having to deal with many
possible inputs in random order is quite a bit harder than simply forcing the user to
supply input in a fixed order.
In the following sections, you will learn how to write Java programs that can react to
user interface events, such as button pushes and mouse clicks. The Java windowing
toolkit has a very sophisticated mechanism that allows a program to specify the
events in which it is interested and which objects to notify when one of these events
occurs.
User interface events include key presses, mouse moves, button clicks, menu
selections, and so on.
Search WWH ::




Custom Search