글
JAVA
import org.kwis.msp.lcdui.*;
import org.kwis.msp.lwc.*;
public class CheckboxEx extends Jlet implements ChangeListener
{
ShellComponent shell = new ShellComponent();
FormComponent form = new FormComponent();
LabelComponent label = new LabelComponent("전화번후부");
CheckboxGroup group = new CheckboxGroup();
CheckboxComponent checkbox1 = new CheckboxComponent("전화번호부",null,group);
CheckboxComponent checkbox2 = new CheckboxComponent("자기정보수정",null,group);
CheckboxComponent checkbox3 = new CheckboxComponent("부가서비스",null,group);
CheckboxComponent checkbox4 = new CheckboxComponent("시스템 정보",null,group);
protected void startApp(String args[])
{
group.setChangeListener(this, null);
group.select(checkbox1);
form.addComponent(label);
form.addComponent(checkbox1);
form.addComponent(checkbox2);
form.addComponent(checkbox3);
form.addComponent(checkbox4);
shell.addComponent(form);
shell.show();
}
protected void pauseApp(){}
protected void resumApp(){}
protected void destroyApp(boolean b){}
public void changed(Component c, Object o)
{
if(group.getSelectedCheckbox() == checkbox1)
{
label.setLabel("전화번호부");
}
else if(group.getSelectedCheckbox() == checkbox2)
{
label.setLabel("자기정보 수정");
}
else if(group.getSelectedCheckbox() == checkbox3)
{
label.setLabel("부가서비스");
}
else
{
label.setLabel("시스템 정보");
}
}
}