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

📄 foreshow.java

📁 手机在线系统 采用Java 中的J2ME, JSP 跟MySql 运行环境是:jsdk1.4以上
💻 JAVA
字号:
/*
 * @(#)Foreshow.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.england;

import com.j2me.main.*;
import  com.j2me.common.*;
import com.j2me.language.*;
import javax.microedition.lcdui.*;

/**
 *类Foreshow是用来描述England足球联赛赛程安排功能菜单界面。
 */
public class  Foreshow extends List implements CommandListener
{
	private Display display = null;
	private England england = null;
	private ForeshowList foreshowList = null;
	private Command backCommand = null;
	private Command okCommand = null;

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

	public  String [] stringMenu = {"赛程安排列表" , "查询赛程"};
    
	/*初始话功能菜单*/
	public	Foreshow()		  
	{
		super("英格兰超级足球联赛赛程安排", List.IMPLICIT);    //继承超类,并设置属性为当选择是当前操作的项目在命令初始化时被选中
		append(stringMenu[0], icon[0]);
		append(stringMenu[1], icon[1]);
		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, England england)	//用来显示界面
	{		
		this.display = display;
	   	this.england = england;
		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(england);
		}
		else
		{
			int listIndex;
			listIndex = this.getSelectedIndex();	 //得到你所选择的是哪个菜单并作出响应, 你按下的是电话薄
			if (listIndex == 0)
			{
				DowloandGuage d = new DowloandGuage();
				if (Language.isEnglish)
				{
					foreshowList = new ForeshowList("Name   -  " + "Game_How   —  " + "Address", display, this);
				}
				else
				{
					foreshowList = new ForeshowList("比赛名   -  " + "英超第几轮   —  " + "地点", display, this);
				}
				d.showForm(display, foreshowList);
			}

			if (listIndex == 1)
			{
				SearchForeshowForm f;
				if (Language.isEnglish)
				{
					 f = new SearchForeshowForm("Search Foreshow");
					 f.nameTextField.setLabel("Name:");
					 f.degreeTextField.setLabel("How:");
				}
				else
				{
					 f = new SearchForeshowForm("搜索赛程");
					 f.nameTextField.setLabel("比赛名:");
					 f.degreeTextField.setLabel("比赛轮数:");
				}
				f.showForm(display, this);
			}
		
		}
	}

}

⌨️ 快捷键说明

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