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 {}
}

:
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);
    }
}

결과화면
사용자 삽입 이미지

:

BLOG main image
아무거나 공부하자!!! by Young79

공지사항

카테고리

분류 전체보기 (79)
Programing (29)
"JAVA"를 잡아라 (22)
달이 차오른다, "LUA" (4)
"WIPI"를 피해라 (3)
English (31)
Graphic (4)
Saying on T"We"tter (15)

최근에 올라온 글

최근에 달린 댓글

글 보관함

달력

«   2025/02   »
1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28
Total :
Today : Yesterday :