|
![]() |
|
=PAppletter Applet er javaprogrammer, der kører i "sandkassen"
=K
Appearance: | <APPLET CODE=string HEIGHT=n
WIDTH=n > </APPLET> |
---|---|
Attributes: | CODEBASE=URL ,
CODE=string , NAME=string ,
ALT=string , ALIGN=left|right|top|middle|bottom,
HEIGHT=n , WIDTH=n ,
HSPACE=n , VSPACE=n |
HTML V.4.0 udfaser APPLET-tag til fordel for OBJECT-tag. =PHTML eksempel Se opgave 2 =POprette Applet
drawLine()
, which draws a line in the Graphics
object's
current color, which is initialized to the Component's foreground
color)
drawRect()
, fillRect()
, and
clearRect()
-- where fillRect()
fills a rectangle
with the Graphics object's current color,
and clearRect()
fills a rectangle
with the Component's background color)
draw3DRect()
and fill3DRect()
)
drawRoundRect()
and fillRoundRect()
)
drawOval()
and fillOval()
)
drawArc()
and fillArc()
)
drawPolygon()
and fillPolygon()
)
Alle - undtagen polygoner og linier defineres af en firkant, der omslutter den. =POpgave 3 Gå til opgave 3 =POpgave 3 - noter Color.red er en henvisning til en klassevariabel i klassen Color. Klassevariable findes ikke i de objekter som den pågældende klasse realiserer.
=PTekster Hvor placeres en tekst: =I13ui38.gif Størrelsen af en sats beskrives med klasse java.awt.FontMetrics