📄 drawlist.java
字号:
import javax.microedition.lcdui.*;
public class DrawList implements CommandListener,ItemStateListener{
public byte modal;
public boolean list_dos;
private Form option_form;
private Command back;
private Display game_display;
private DrawCanvas drawcanvas;
public DrawList(Display display){
game_display=display;
back=new Command("返回",Command.BACK,1);
option_form=new Form("游戏设置");
StringItem stringitem=new StringItem(null,"你可以选择不同的难度来进行游戏:");
stringitem.setFont(Font.getFont(Font.FACE_SYSTEM, Font.STYLE_BOLD, Font.SIZE_LARGE));
option_form.append(stringitem);
ChoiceGroup listselect=new ChoiceGroup(null,Choice.EXCLUSIVE);
listselect.append("只使用0~9之间的数字", null);
listselect.append("使用0~9和10,J,Q,K之间的数字",null);
for(int i=0;i<2;i++)
listselect.setFont(i, Font.getFont(Font.FACE_SYSTEM, Font.STYLE_PLAIN, Font.SIZE_LARGE));
option_form.append(listselect);
option_form.addCommand(back);
option_form.setCommandListener(this);
option_form.setItemStateListener(this);
}
public void get_canvasform(DrawCanvas drawcanvas){
this.drawcanvas=drawcanvas;
}
public Form get_form(){
return option_form;
}
public void commandAction(Command c,Displayable d){
if(c==back){
list_dos=true;
drawcanvas.set_index_title((short)0);
drawcanvas.scene_ID=0;
game_display.setCurrent(drawcanvas);
}
}
public void itemStateChanged(Item item){
ChoiceGroup tmp=(ChoiceGroup)item;
modal=(byte)tmp.getSelectedIndex();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -