📄 viewerform.java
字号:
import javax.microedition.lcdui.*;
public class ViewerForm extends Form implements CommandListener
{
private Command exit=null,viewer=null, publicViewer;
private MainSelect mainSelect=null;
private ChoiceGroup saveChoice, musicChoice, soundChoice;
private String saveChoiceString[]={"不保存","保存"}, musicChoiceString[] = {"打开","关闭"} ,soundChoiceString[] = {"打开","关闭"};
public ViewerForm(MainSelect ms)
{
super("看擂设置");
mainSelect=ms;
//*********界面初始化
saveChoice=new ChoiceGroup("是否保存记录",Choice.EXCLUSIVE,saveChoiceString,null);
musicChoice=new ChoiceGroup("背景音乐",Choice.EXCLUSIVE,musicChoiceString,null);
soundChoice=new ChoiceGroup("走步提示",Choice.EXCLUSIVE,soundChoiceString,null);
append(saveChoice);
append(musicChoice);
append(soundChoice);
//*********命令初始化
exit=new Command("Exit",Command.EXIT,1);
viewer=new Command("电台",Command.OK,1);
publicViewer =new Command("观众",Command.OK,1);
addCommand(exit);
addCommand(viewer);
addCommand(publicViewer);
setCommandListener(this);
}
public void commandAction(Command com,Displayable dis)
{
if(com==exit)
{
Chess.dis.setCurrent(mainSelect);
}
else
{
int saveIndex=saveChoice.getSelectedIndex();
int musicIndex=musicChoice.getSelectedIndex();
int soundIndex=soundChoice.getSelectedIndex();
if(com==viewer)
{
ViewerCanvas viewerCanvas = new ViewerCanvas(mainSelect, saveIndex, musicIndex, soundIndex);
Chess.dis.setCurrent(viewerCanvas);
}
if(com==publicViewer)
{
PublicCanvas publicCanvas = new PublicCanvas(mainSelect, saveIndex, musicIndex, soundIndex);
Chess.dis.setCurrent(publicCanvas);
}
}
}
};
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -