JAVA

프로그래밍 2009. 3. 19. 00:52


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

public class ListEx extends Jlet implements ActionListener, ChangeListener{
 ShellComponent shell = new ShellComponent();
 FormComponent form = new FormComponent();
 LabelComponent label = new LabelComponent();
 ListComponent list = new ListComponent(ListComponent.SELECT_EXCLUSIVE);

 protected void startApp(String args[]){
  list_set();

  form.addComponent(label);
  form.addComponent(list);
  shell.addComponent(form);
  shell.show();
 }

 protected void destroyApp(boolean b){}
 public void action(Component c, Object o){
  label.setLabel(list.getString(list.getSelectedIndex()));
 }
 public void changed(Component c, Object o){
  action(c,o);
 }

 protected void list_set(){
  ListItemComponent item1 = new ListItemComponent("화면 설정");
  ListItemComponent item2 = new ListItemComponent("소리 설정");
  ListItemComponent item3 = new ListItemComponent("주소록 보기");
  ListItemComponent item4 = new ListItemComponent("게임 하기");
  
  list.addComponent(item1); list.addComponent(item2);
  list.addComponent(item3); list.addComponent(item4);
  
  list.setActionListener(this, null);
  list.setChangeListener(this, null);
 }
}

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

JAVA  (0) 2009.03.31
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
JAVA  (1) 2009.03.17
JAVA  (0) 2009.03.16
JAVA  (1) 2009.03.13
JAVA  (0) 2009.03.12

설정

트랙백

댓글