글
JAVA
프로그래밍
2009. 4. 28. 17:30
import org.kwis.msp.lcdui.*;
public class PolyEx extends Jlet
{
protected void startApp(String args[])
{
Display dp = Display.getDefaultDisplay();
PolyCard card = new PolyCard();
dp.pushCard(card);
}
protected void destroyApp(boolean b){}
}
class PolyCard extends Card
{
protected void paint(Graphics g)
{
int i = 10; //위 아래 좌우 공간을 동일한 비율로 설정
int x[] = {(getWidth()/2), i, (getWidth()-i)};
int y[] = {i, (getHeight()-i), (getHeight()-i)};
g.setColor(0xffffff);
g.fillRect(0, 0, getWidth(), getHeight());
g.setColor(0x000000);
//다각형 그리기
g.drawPolygon(x, y);
}
}