FormComp.java
import org.kwis.msp.lcdui.Jlet;
import org.kwis.msp.lcdui.JletStateChangeException;
import org.kwis.msp.lwc.FormComponent;
import org.kwis.msp.lwc.LabelComponent;
import org.kwis.msp.lwc.ShellComponent;
public class FormComp extends Jlet {
protected void startApp(String[] arg0) {
ShellComponent shell = new ShellComponent();
FormComponent form = new FormComponent();
form.addComponent(new LabelComponent("위피 프로젝트"));
form.addComponent(new LabelComponent("라벨컴포넌트"));
shell.addComponent(form);
shell.show();
}
protected void pauseApp(){}
protected void resumeApp(){}
protected void destroyApp(boolean arg0) throws JletStateChangeException {}
}
'Programing/"WIPI"를 피해라'에 해당되는 글 3건
ShellCompo.java
import org.kwis.msp.lcdui.*;
import org.kwis.msp.lwc.*;
public class ShellCompo extends Jlet {
protected void startApp(String args[]) {
ShellComponent test = new ShellComponent();
test.setTitle(new LabelComponent("제목 컴포넌트"));
test.addComponent(new ButtonComponent("작업 컴포넌트", null));
test.setCommand(new ButtonComponent("커맨드 컴포넌트", null), false);
test.show();
}
protected void pauseApp(){}
protected void resumeApp(){}
protected void destroyApp(boolean b){}
}
HelloWipi.java
import org.kwis.msp.lcdui.*;
public class HelloWipi extends Jlet {
// 프로그램 시작
public void startApp(String[] arg0) {
// 기본적인 Display 생성
Display test = Display.getDefaultDisplay();
// card 객체를 생성
CardTest card = new CardTest();
// card 객체를 pushCard 를 사용하면 아래의 CardTest.java
// paint 메소드를 한번 호출.
test.pushCard(card);
}
public void pauseApp(){} // 프로그램을 일시정지시 호출
public void resumeApp(){} // 프로그램을 다시 실행시 호출
// 프로그램을 종료시 호출
public void destroyApp(boolean arg0){
}
}
CardTest.java
import org.kwis.msp.lcdui.*;
public class CardTest extends Card {
// 위의 HelloWipi.java 에서 사용된 pushCard 에 의해서 호출되어짐
public void paint(Graphics a){
// 시작점 (10, 10), 위치(a.TOP | a.LEFT) 설정 및 화면 출력
a.drawString("Hello~ This is Young.", 10, 10, a.TOP | a.LEFT);
}
}
결과화면