검색결과 리스트
전체 글에 해당되는 글 238건
- 2009.03.19 JAVA
글
JAVA
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);
}
}