FileDocCategorySizeDatePackage
GraphApplet.javaAPI DocSun JDK 1.5.0 Example2295Sat Jan 08 15:09:03 GMT 2005None

GraphApplet

public class GraphApplet extends Applet

Fields Summary
Constructors Summary
Methods Summary
doublef(double x)

	return (Math.cos(x/5) + Math.sin(x/7) + 2) * getSize().height / 4;
    
public java.lang.StringgetAppletInfo()

    return "Draws a sin graph.";
  
public voidpaint(java.awt.Graphics g)

        for (int x = 0 ; x < getSize().width ; x++) {
	    g.drawLine(x, (int)f(x), x + 1, (int)f(x + 1));
        }