import java.applet.*; import java.awt.*; public class SimpleGraph extends Applet { String theFunction; Parser theParser; Graph theGraph; double xMin, xMax, yMin, yMax; public void init() { theFunction = super.getParameter("function"); xMin = Double.valueOf(super.getParameter("xmin")).doubleValue(); xMax = Double.valueOf(super.getParameter("xmax")).doubleValue(); yMin = Double.valueOf(super.getParameter("ymin")).doubleValue(); yMax = Double.valueOf(super.getParameter("ymax")).doubleValue(); theParser = new Parser(1); theParser.defineVariable(1,"x"); theGraph = new Graph(theFunction, theParser, xMin, xMax, yMin, yMax, Color.blue, size()); } public void paint(Graphics g) { theGraph.drawAxis(g, Color.red); theGraph.drawGraph(g); } }