JAVA

프로그래밍 2009. 3. 31. 13:41

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("시스템 정보");
  }
 }
}

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

JAVA  (0) 2009.04.12
JAVA  (0) 2009.04.10
JAVA  (0) 2009.04.07
JAVA  (0) 2009.04.04
JAVA  (0) 2009.04.03
JAVA  (2) 2009.03.27
JAVA  (0) 2009.03.26
JAVA  (0) 2009.03.23
JAVA  (0) 2009.03.22
JAVA  (0) 2009.03.20

설정

트랙백

댓글