import javax.microedition.lcdui.*;
import javax.microedition.midlet.*;
public class GraphicsTest extends MIDlet{
private Display display;
public GraphicsTest() {
display=Display.getDisplay(this);
}
protected void destroyApp(boolean unconditional) {
}
protected void pauseApp() {
}
protected void startApp(){
MyCanvas mc=new MyCanvas();
display.setCurrent(mc);
}
}
class MyCanvas extends Canvas {
public void paint(Graphics g){
int width=getWidth();
int height=getHeight();
g.setColor(0);
g.fillRect(0, 0, width, height);
int a=width/5;
int b=height/5;
g.setColor(0Xffff00);
for(int i=1;i<=4;i++){
g.drawLine(a,0 ,a,height);
g.drawLine( 0,b, width,b);
a=a+width/5;
b=b+height/5;
} g.drawArc(0, 0, width, height, 0, 360);
}
}