Before concluding at the AWT, one more topic needs to be discussed: handling events by extending components. The delegation event model was introduced in Chapter 20, and all of the programs in this book so far have used that design. But Java also allows you to handle events by  AWT components. Doing so allows you to handle events in much the same way as they were handled under the original 1.0 version of Java. Of course, this technique is discouraged, because it has the same disadvantages of the Java 1.0 event model, the main one being inefficiency. Handling events by extending Awr components is described in this.section for completeness. However, this technique is not used  other sections of this book. To extend an AWT component, you must call theenable Events( ) method  of  Component. Its general form is shown here:protected final void enable Events(long event Mask)

[vfb id=1]

Share This