Top
Previous Next
Interfaces, GUIs, and Applets CS 161 - Java

JDK 1.1 Event Model - Different from JDK 1.0

In JDK 1.1 and beyond,
Every time the user types a character or pushes a mouse button, an event occurs. Any object can be notified of the event. All it has to do is implement the appropriate interface and be registered as an event listener on the appropriate event source.
from: The Java Tutorial, Campione & Walrath, 1999

Typical Java GUI Application

// create user interface

...

// tell user interface components which objects are interested in things
// that happen to them

...

while (true) {

  letThingsHappen();

  // user interface components will tell interested objects about the
  // happenings

}

Top
Previous Next
jwd