Beruflich Dokumente
Kultur Dokumente
Applet
When a browser renders this HTML file, it will display underlined text
and the applet whose byte code is in the file “file.class”
OR
}
}
}
}
public class MyApplet extends Applet
{
public void paint(Graphics g)
{
Graphics2D g2 = (Graphics2D)g;
// use more sophisticated Java
graphics class
//need for 2D objects. . .
}
}
import java.applet.Applet;
import java.awt.Graphics;
import java.awt.Graphics2D;
/*<applet code=“MyApplet "
width="640" height="480">
</applet>*/
what is that?
To use these classes you must import them. To import these classes, you
import only the outer class:
import java.awt.geom.Ellipse2D; // no .Double
The Line2D class
http://java.sun.com/j2se/1.4.2/docs/api/index.html
Line2D.Double myLine;
myLine = new Line2D.Double(xpos, ypos, xpos+len,
ypos);
g2obj.draw(myLine);
setColor(Color c)