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

A Typical Event Driven Application

Somewhere inside most modern applications that use a graphical user interface (and in many other types of applications using the Event Driven model) is what amounts to an infinite loop.

The infinite loop may be hidden away inside an application framework you are using.

Whether hidden or not, those infinite loops look something like the following pseudo code:

while (true) {

  event = waitForSomethingInterestingToHappen();

  callThingThatRegisteredInterest( event );

}

Event Driven Programming is all about writing the methods that are the thingThatRegisteredInterest in handling some event, e.g.,

Question: How is event driven programming different from what we've done so far?


Top
Previous Next
jwd