※リストが表示されない場合
AddBlockなどの広告ブロックツールがONになっているとリストなどが表示されない場合があります。これらのツールをOFFにしてみてください。
※MainPanelの修正
class MainPanel extends Panel implements ComponentListener {
private Label label;
private ListBox list;
MainPanel() {
setTitle("Start IApplication");
HTMLLayout layout = new HTMLLayout();
this.setLayoutManager(layout);
label = new Label("List Sample");
this.add(label);
layout.br();
list = new ListBox(ListBox.SINGLE_SELECT);
list.append("Windows");
list.append("Linux");
list.append("Mac OS X");
this.add(list);
this.setComponentListener(this);
}
public void componentAction(Component source, int type, int param) {
switch(type){
case ComponentListener.SELECTION_CHANGED:
if (source == list){
int n = list.getSelectedIndex();
label.setText(list.getItem(n));
}
break;
}
}
}
| << 前へ | 次へ >> |