Components Java Help


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)

  • Feel free to send us an inquiry, we will reply back in hours.


Posted on September 18, 2014 in Using AWT Controls

Share the Story

About the Author

Back to Top
Share This