您的位置:寻梦网首页编程乐园Java天地Core JavaJava Lecture Notes

Introduction

Content

Apply

Reflect

Extend

previous.gif
 (3087 bytes)

next.gif
 (2959 bytes)


Content Index

Content Page # 17

Event-driven programming

With a graphical user interface, Java makes use of a technique called event-driven programming. This means that when certain events occur (e.g., the user clicks on a button, the mouse is moved, etc) then a corresponding method is executed. You will already have seen this in the BallWorld application, which had a method called paint. The program did not indicate when to execute this method; it is executed whenever a repaint event occurs. The Java system knows when the display needs to be updated, and generates this event automatically — for example when a window is resized or revealed by the minimizing of another window. Events, and event-driven programming, will be investigated later this module.

basicline.gif (169 bytes)

RITSEC - Global Campus
Copyright ?1999 RITSEC- Middlesex University. All rights reserved.
webmaster@globalcampus.com.eg