1、外文原文外文原文 Java events are part of the Java AWT (Abstract Windowing Toolkit) package. An event is the way that the AWT communicates to you, as the programmer, and to other Java AWT components that something has happened. That something can be input from the user (mouse movements or clicks, keypresses)
2、, changes in the system environment (a window opening or closing, the window being scrolled up or down), or a host of other things that might, in some way, be interesting to the operation of the program. Note: Javas Abstract Windowing Toolkit is a package of classes that implements most common UI co
3、mponents, such as windows, buttons, menus, and so on. It is also specifically the AWT, and not Java, that generates and manages events. In other words, whenever just about anything happens to a Java AWT component, including an applet, an event is generated. Some events are handled by the AWT or by t
4、he browser without your needing to do anything. paint() methods, for example, are generated and handled by the browserall you have to do is tell the AWT what you want painted when it gets to your part of the window. Some events, howeverfor example, a mouse click inside the boundaries of your applety
5、ou may need to know about. Writing your Java programs to handle these kinds of events enables you to get input from the user and have your applet change its behavior based on that input.Today, youll learn about managing simple events, including the following basics: nnMouse clicks nnMouse movements,
6、 including mouse dragging nnKeyboard actions Youll also learn about the handleEvent() method, which is the basis for collecting, handling,and passing on events of all kinds from your applet to other UI components in the window or in your applet itself. Tomorrow, youll learn how to combine events with the AWT to create a complete interface for your applet. Mouse Clicks Lets start with the most common event you might be interested in: mouse clicks. Mouse-click events occur when your