⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 clientform.java

📁 这是一个Java编写的手机象棋游戏
💻 JAVA
字号:
import javax.microedition.lcdui.*;

public class ClientForm extends Form implements CommandListener
{
	private Command		exit=null,ok=null;
	private MainSelect	mainSelect=null;
	private ChoiceGroup	saveChoice, musicChoice, soundChoice;
	private String		saveChoiceString[]={"不保存","保存"} ,musicChoiceString[] = {"打开","关闭"} ,soundChoiceString[] = {"打开","关闭"};
	
	public ClientForm(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);
		ok=new Command("OK",Command.OK,1);
		addCommand(exit);
		addCommand(ok);
		setCommandListener(this);
	}

	public void commandAction(Command com,Displayable dis)
	{
		if(com==exit)
		{
			Chess.dis.setCurrent(mainSelect);
		}
		if(com==ok)
		{
			int saveIndex = saveChoice.getSelectedIndex();
			int	musicIndex=musicChoice.getSelectedIndex();
			int	soundIndex=soundChoice.getSelectedIndex();
			new ClientChess(mainSelect,saveIndex, musicIndex, soundIndex);
		}
	}
};

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -