Académique Documents
Professionnel Documents
Culture Documents
g.drawLine(x,y,width, height)
If width and height are same, it draws a circle
import java.awt.*;
import java.applet.*;
g.drawLine(x1,y1,x2,y2)
g.drawLine(x,y,width,height)
Drawing arc.
180
180
5
Output!
//Head
//Left eye
//Right eye
//Pupil (left)
//Pupil (right)
//Nose
//Mouth
//Left ear
//Right ear
Drawing Polygons
10
Polygon output
2000
Turno 110
ver
11
2001
2002
2003
150
100
170
import java.awt.*;
import java.applet.*;
13
14
Output
<HTML>
<APPLET
CODE=BarChart.class
WIDTH=300
HEIGHT=250>
<PARAM NAME="columns" VALUE="4">
<PARAM NAME="c1" VALUE="110">
<PARAM NAME="c2" VALUE="150">
<PARAM NAME="c3" VALUE="100">
<PARAM NAME="c4" VALUE="170">
<PARAM NAME="label1" VALUE=2000">
<PARAM NAME="label2" VALUE=" 2001">
<PARAM NAME="label3" VALUE=" 2002">
<PARAM NAME="label4" VALUE=" 2003">
</APPLET>
</HTML>
15
Summary
16