Adapter Classes

Adapter Classes Java provides a special feature, called an adapter class, that call simplify the creation of event handlers in certain situations. An adapter class provides an empty implementation of all me mods in an event listener interface. Masterclasses are useful...

Handling Mouse Events

Handling Mouse Events To handle mouse events, you must implement tile Mouse Listener and the Mouse Motion Listener interfaces. The following applet demonstrates the process. It displays the current coordinates of the mouse in the applet's status window. Each lime .a...

EVENT LISTENER INTERFACE

EVENT LISTENER INTERFACE As explained, the delegation event model has two parts: sources and listeners. Listeners are created by implementing one or more of the interfaces defined by the java awt event package. When an event occurs, the event source invokes the...

The MouseEvent Class

The Mouse Event Class There are seven types of mouse events. The Mouse Event class defines the following integer constants that can be used to identify them: Here, src is a reference to the component that generated the event. The type of the event is specified by...

The Container Event Class

The Container Event Class A Focus Event is generated when a component gains or loses input focus. These events are identified by the integer constants FOCUS_GAINED and FOCUS_LOST. Focus Event is a subclass of Component Event and has these constructors: Event(Component...

Events

Events In the delegation model, an cu cut is an object that describes a stall' change in a source. It can be generated as a consequence of a person interacting with the elements in a graphical user interface. Some of the activities that cause events to be generated...