JAVA

프로그래밍 2009. 4. 4. 22:15

import org.kwis.msp.lcdui.*;
import org.kwis.msp.lwc.*;

public class TextboxEx extends Jlet implements ActionListener
{
 int i;

 ShellComponent shell = new ShellComponent();
 FormComponent form = new FormComponent();

 TextBoxComponent textbox = new TextBoxComponent("",TextBoxComponent.CONSTRAINT_NUMBER);

 ButtonComponent button = new ButtonComponent("입력",null);
 LabelComponent label = new LabelComponent("0개 입력 완료");
 protected void startApp(String args[]) {
  button.setActionListener(this, null);

  form.addComponent(textbox);
  form.addComponent(button);
  form.addComponent(label);

  shell.setTitle("HP를 입력하세요.");
  shell.addComponent(form);
  shell.show();
 }

 protected void destroyApp(boolean b){}

 public void action(Component c, Object o) {
  i++;
  textbox.setString("");
  label.setLabel(i + "개 입력 완료");
 }
}


'프로그래밍' 카테고리의 다른 글

JAVA  (0) 2009.04.16
JAVA  (1) 2009.04.15
JAVA  (0) 2009.04.12
JAVA  (0) 2009.04.10
JAVA  (0) 2009.04.07
JAVA  (0) 2009.04.03
JAVA  (0) 2009.03.31
JAVA  (2) 2009.03.27
JAVA  (0) 2009.03.26
JAVA  (0) 2009.03.23

설정

트랙백

댓글