?? mullisttest.java
字號:
//MULListTest.java
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
public class MULListTest extends MIDlet implements CommandListener
{
private Display display;
Command commit ;
public MULListTest()
{
display = Display.getDisplay(this);
}
public void startApp()
{
commit = new Command("Commit",Command.SCREEN,1) ;
List l = new List("興趣愛好",Choice.MULTIPLE) ;
l.append("藍球",null) ;
l.append("足球",null) ;
l.append("乒乓",null) ;
l.append("游泳",null) ;
l.addCommand(commit) ;
l.setCommandListener(this) ;
display.setCurrent(l) ;
}
public void pauseApp()
{}
public void destroyApp(boolean unconditional)
{}
public void commandAction(Command c,Displayable s)
{
if(c == commit)
{
List tmp = (List) s ;
int num = tmp.size() ;
for(int i = 0 ; i < num ; i++)
{
if(tmp.isSelected(i))
{
System.out.println("Item " + i + "selected") ;
}
}
}
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -