O'Reilly logo

JavaBeans Unleashed by Rick Leinecker, Dr. Donald Doherty

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Communicating Events Created by Java Components

Users talk to a bean through event objects created by interacting with the bean's graphic user interface. JavaBeans graphic user interfaces are typically composed of components from the AWT or Swing. In this section, you learn how to register event listeners with AWT or Swing components. Afterwards, you'll use your new knowledge to write beans that respond to user interactions.

Registering Event Listeners

Each Java AWT and Swing component can create event objects in response to all sorts of user interactions. For instance, a java.awt.Button object can produce java.awt.event. ActionEvent, java.awt.event.ComponentEvent, java.awt.event.FocusEvent, java.awt.event.KeyEvent, java.awt.event.MouseEvent, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required