Consuming Events

Sometimes an application needs to keep some events from being processed normally by a component. For example, a visual interface builder might need to allow a user to drag a button around the screen. In this case, you wouldn't want the mouse press to activate the button.

You can consume an InputEvent, that is a MouseEvent or a KeyEvent, by calling its consume() method:

public void consume()

Once an InputEvent is consumed, the source component will not process the event itself. However, the event will still be dispatched to all registered listeners.

Previous | Next | Top | Cafe au Lait

Copyright 1997 Elliotte Rusty Harold
Last Modified March 16, 1997