import javax.microedition.midlet.MIDlet; import javax.microedition.lcdui.Display; import javax.microedition.lcdui.Displayable; import javax.microedition.lcdui.Canvas; import javax.microedition.lcdui.Graphics; public class Graph extends Canvas { private Display display; private Graph graph; public void paint(Graphics g) { int width = g.getClipWidth(); int height = g.getClipHeight(); g.setColor(255,255,0); g.fillRect(0,0,width,height); g.setColor(0,0,0); g.drawRect(0,0,width - 1,height - 1); g.drawLine(width/2,0,width/2,height); g.drawLine(0,height/2,width,height/2); g.translate(width/2,height/2); g.setColor(255,0,0); for(int x = - width/2;x < width/2;x++) { int y = - x * x/40; g.drawLine(x,y,x,y); } } public void startApp() { Graph graph = new Graph(); display = Display.getDisplay(this); display.setCurrent(graph); } public void pauseApp() { } public void destroyApp(boolean unconditional) { } }