글
JAVA
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 + "개 입력 완료");
}
}