Java Reference
In-Depth Information
The HTML file for this program contains the following code:
<HTML>
<HEAD>
<TITLE>ONECHAR APPLET</TITLE>
</HEAD>
<BODY>
<OBJECT code = "OneChar.class" width = "350" height = "300">
</OBJECT>
</BODY>
</HTML>
Sample Run: Figure 12-22 shows a sample run of the OneChar applet. (Notice that
Figure 12-22 does not show the message dialog box. However, when you execute this
program, it first shows the message dialog box.)
FIGURE 12-22 Sample run of the OneChar applet
Mouse Events
This section describes how to handle mouse events. A mouse can generate seven different
types of events, as shown previously in Table 12-14. Some mouse events are handled by
the interface MouseListener and others are handled by the interface
MouseMotionListener . Table 12-14 also shows which listener method is executed
when a particular mouse event occurs. Example 12-9 illustrates how to handle mouse
events.
 
 
 
Search WWH ::




Custom Search