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

📄 lotterylist.java

📁 手机在线系统 采用Java 中的J2ME, JSP 跟MySql 运行环境是:jsdk1.4以上
💻 JAVA
字号:
/**
 * @(#)LotteryList.java	1.11 01/08/23
 * Copyright (c) 2004-2005 wuhua of workroom Inc. All Rights Reserved.
 * @version 	1.0, 10/05/2004
 * @author 	饶荣庆
 * @author 	余煜辉
 */

package com.j2me.football.football_lottery;

import com.j2me.football.*;
import com.j2me.language.*;
import com.j2me.common.*;
import java.io.*;
import javax.microedition.lcdui.*;

/**
 *此类是足球彩票投注的主菜单类
 */
public class LotteryList extends List implements CommandListener
{
	/*显示类*/
	private Display display = null;

	/*动感足球主菜单*/
	private MainFootballList main;

	/*专家建议类*/
	private ExpertList expert;

	/*足彩投注类*/
	private LotteryChoice lotteryChoice; 

	/*足球彩票结果类*/
	private ResultList result;

	/*费用列表类*/
	public ExpenseList expense;

	/*软键类*/
	private Command backCommand = null;
	private Command okCommand = null;

	public Image[] icon = { createImage("/icon/phone.png"),createImage("/icon/football.png"),
		                    createImage("/icon/english.png"),  createImage("/icon/counter.png"),
		                    createImage("/icon/about.png")};

	public LotteryList()
	{
		super("足彩票菜单", List.IMPLICIT);    //继承超类,并设置属性为当选择是当前操作的项目在命令初始化时被选中
		append("足球专家的建议", icon[0]);
		append("进入足球彩票投注", icon[1]);
		append("足彩结果", icon[2]);
		append("资费标准", icon[3]);
		append("关于", icon[4]);
		this.backCommand = new Command("返回", Command.BACK, 2);
		this.okCommand = new Command("确定", Command.OK, 2);
		this.addCommand(backCommand);
		this.addCommand(okCommand);
		this.setCommandListener(this);
	}

	/*
	 *显示菜单界面方法
	 */
	public void showForm(Display display, MainFootballList main)	//用来显示界面
	{		
		this.display = display;
	   	this.main = main;
		this.display.setCurrent(this);
	}

	private Image createImage(String name)	 //定义创建菜单图片
	{
		Image aImage =null;
        try
		{ 
			aImage = Image.createImage(name);
		}
		catch(Exception e)
		{
			System.out.println("不能找到图标.");
		}
        return aImage;
     }

	 
	public void commandAction(Command c, Displayable s)
	{
		if(c == backCommand)
		{
			this.display.setCurrent(main);
		}

		if (c == okCommand)
		{
			int listIndex;
			listIndex = this.getSelectedIndex();	 //得到你所选择的是哪个菜单并作出响应, 你按下的是电话薄

			if (listIndex == 0)
			{
				/*判断用户选择的语言*/
				if (Language.isEnglish)
				{
					expert = new ExpertList();
					expert.setTitle("Expert Suggest " + expert.data[0]);
					expert.set(0, "Expert Suggest One", expert.icon[0]);
					expert.set(1, "Expert Suggest Two", expert.icon[1]);
					expert.set(2, "Expert Suggest Three", expert.icon[2]);
					expert.set(3, "Expert Suggest Four", expert.icon[3]);
					expert.set(4, "Expert Suggest Five", expert.icon[4]);
					expert.showForm(display, this);
				}
				else
				{
					expert = new ExpertList();
					expert.setTitle("专家建议 " + expert.data[0]);
					expert.set(0, "专家建议一", expert.icon[0]);
					expert.set(1, "专家建议二", expert.icon[1]);
					expert.set(2, "专家建议三", expert.icon[2]);
					expert.set(3, "专家建议四", expert.icon[3]);
					expert.set(4, "专家建议五", expert.icon[4]);
					expert.showForm(display, this);
				}
			}

			if (listIndex == 1)
			{
				DowloandGuage d = new DowloandGuage();	//连网的进度条
				if (Language.isEnglish)
				{
					lotteryChoice = new LotteryChoice("Fottball Ballot", display, this);
				}
				else
				{
					lotteryChoice = new LotteryChoice("足球彩票投注:", display, this);
				}
				//当进度条好了以后,进入下个界面
				d.showForm(display, lotteryChoice);
			}

			if (listIndex == 2)
			{
				if (Language.isEnglish)
				{
					result = new ResultList();
					result.setTitle("Result Lottery" + result.data[0]);
					result.set(0, "Result of Lottery", result.icon[0]);
					result.set(1, "Result of Person", result.icon[1]);
				}
				else
				{
					result = new ResultList();
					result.setTitle("Result Lottery" + result.data[0]);
					result.set(0, "开奖结果", result.icon[0]);
					result.set(1, "中奖没有", result.icon[1]);
				}
				result.showForm(display, this);
			}

			if (listIndex == 3)
			{
				if (Language.isEnglish)
				{
					expense = new ExpenseList();
					expense.setTitle("Expense Menu");
					expense.set(0, "Lottery Expense", expense.icon[0]);
					expense.set(1, "Info Expense", expense.icon[1]);
					expense.set(2, "Expert Expense", expense.icon[2]);
					expense.showForm(display, this);
				}
				else
				{
					expense = new ExpenseList();
					expense.setTitle("咨费菜单");
					expense.set(0, "竟猜费用", expense.icon[0]);
					expense.set(1, "信息费用", expense.icon[1]);
					expense.set(2, "咨询专家费用", expense.icon[2]);
					expense.showForm(display, this);
				}
			}

			if (listIndex == 4)
			{
				if (Language.isEnglish)
				{
					String aboutStr =
					   "    欢迎来到动感在线\n"
					 + "    欢迎来到足球彩票竟猜\n"
					 + "    首先祝福大家好运\n"
					 + "    \n"
					 + "    \n"
					 + "    现在介绍下游戏规则:  \n"
					 + "    竟猜的主要规则是:\n"
					 +"     由意大利足球甲级联赛的9轮比赛加\n"
					 + "    上英国足球超级联赛的4轮一共是13\n"
					 + "    轮,用户选则主队胜则代号为3,平为1,\n"
					 + "    负为0用户猜中11场为3\n"
					 + "    1: 本竟猜是由国外**公司全球总发行\n"
					 + "    2: 由中国无花博采公司全权代理国外公司在\n"
					 + "        中国的发行\n"
					 + "    3: 如有疑问请打020 - 38491064"
					 + "               作者:饶荣庆   余煜辉";
					 
					 Image image = null;
                     try
					 {
		       			image =Image.createImage("/icon/jabout.png");
					 }
					 catch(Exception e)
					 {}

					 Alert aboutAlert = new Alert("Help", aboutStr, image, AlertType.INFO);
					 this.display.setCurrent(aboutAlert);
				}
				else
				{
					 String aboutStr =
					   "    欢迎来到动感在线\n"
					 + "    欢迎来到足球彩票竟猜\n"
					 + "    首先祝福大家好运\n"
					 + "    \n"
					 + "    \n"
					 + "    现在介绍下游戏规则:  \n"
					 + "    竟猜的主要规则是:\n"
					 +"     由意大利足球甲级联赛的9轮比赛加\n"
					 + "    上英国足球超级联赛的4轮一共是13\n"
					 + "    轮,用户选则主队胜则代号为3,平为1,\n"
					 + "    负为0用户猜中11场为3\n"
					 + "    1: 本竟猜是由国外**公司全球总发行\n"
					 + "    2: 由中国无花博采公司全权代理国外公司在\n"
					 + "        中国的发行\n"
					 + "    3: 如有疑问请打020 - 38491064"
					 + "               作者:饶荣庆   余煜辉";
					 
					 Image image = null;
                     try
					 {
		       			image =Image.createImage("/icon/jabout.png");
					 }
					 catch(Exception e)
					 {}

					 Alert aboutAlert = new Alert("帮助", aboutStr, image, AlertType.INFO);
					 this.display.setCurrent(aboutAlert);
				}

			}
			
		}
	}

}




⌨️ 快捷键说明

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