Semantic Events

The majority of AWT events are component events, such as mouse down, key pressed, etc. The AWT also provides semantic events, which are higher-level events, such as an action event. Semantic events do not equate to any single component event but describe an event that may consist of a number of component events. Semantic events, in contrast to component events, are always consumed—semantic events are not passed to a component's peer.

For instance, if you wheel the mouse (mouse moved) into a java.awt.Button (mouse entered), press the mouse button (mouse pressed), and release it inside of the button (mouse clicked), the button will fire an action event.

Semantic events are handled in exactly the same manner as component inputs; ...

Get Graphic Java™ 1.2, Volume I: AWT, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.