(1) Events (event): Describes the object in which an event occurs;
(2) event Source: event generator; (3) Event Handlers: Method for accepting event objects, interpreting event objects, and processing user interactions; (4) event model of jdk1.1; delegate model; event listener: class that implements the listener interface. A listener object is an instance of the class that implements the special listener interface; The event sources and event handlers are separated;When the button event is triggered by an action event, if the button registers an event listener, it will be handled by the actionperform event listener in the event listener; ----- "event processor; as you can see, the delegate model separates the event source and event processing. (5) The Listener interface is in Java. AWT. in the event package; (6)
Create a listener class implementation interface windowlistener; we need to implement the methods in this interface, of course, this interface has many methods, so we can create an adapter class, this class is abstract, it implements all the methods in windowlistener, but it is a null implementation, So we declare the adapter class as an abstract, because if it is not abstract, we can construct it, it makes no sense to construct it, because the methods in implementing windowlistener in it are empty implementations, so the adapter class is declared as abstract;(7) four containers are required to use four layout managers. (8) Click the event: actionevent. the corresponding listener is actionlistener. does the actionlistener interface have an adapter class? There is one of its methods: actionreceivmed. It does not have the corresponding adapter class; keylistener/windowlistener/mouse listener also has the corresponding adapter class; but why does it not?