Java Reference
In-Depth Information
case
2:
g.drawOval(x, y, width, height);
break
;
case
3:
g.fillOval(x, y, width, height);
}
//end switch
}
//end for
}
}
The HTML file for this program contains the following code:
<HTML>
<HEAD>
<TITLE>WELCOME APPLET</TITLE>
</HEAD>
<BODY>
<OBJECT code = "OvalRectApplet.class" width = "400"
height = "300">
</OBJECT>
</BODY>
</HTML>
Sample Run: Figure 12-8 shows a sample run of
OvalRectApplet
.
1
2
FIGURE 12-8
Sample Run of
OvalRectApplet
Note that in this sample run, a figure drawn later has visual priority over a figure drawn earlier.
Search WWH ::
Custom Search