글
JAVA
프로그래밍
2009. 4. 28. 13:38
import org.kwis.msp.lcdui.*;
import org.kwis.msp.lwc.*;
public class ArcEx extends Jlet
{
protected void startApp(String args[])
{
Display dp = Display.getDefaultDisplay();
ArcCard card = new ArcCard();
dp.pushCard(card);
}
protected void destroyApp(boolean b){}
}
class ArcCard extends Card {
protected void paint(Graphics g) {
int width = 100, height = 150;
int arc = 0;
g.setColor(0xffffff);
g.fillRect(0, 0, getWidth(), getHeight());
g.setColor(0xff0000);
for(int i=1; i<5; i++) {
ack = 90 * i;
if(i % 2 == 0)
//원호 그리기
g.drawArc(10, 5, width, height, arc, 90);
else
//속에 색칠된 원호 그리기
g.fillArc(10, 5, width, height, arc, 90);
}
}
}