📄 pointform.java
字号:
/*
* @(#)PointForm.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.language.*;
import com.j2me.common.*;
import java.io.*;
import javax.microedition.lcdui.*;
/*
*此类是用来读取数据库球队的在球赛中的积分表,并把它读取到手机用户上以供用户浏览
*/
public class PointForm extends Form implements CommandListener
{
/*显示类*/
private Display display = null;
/*用于切换的界面类*/
public England england = null;
//错误
private Alert errorAlert = null;
private Command backCommand = null;
public PointForm(String s, Display display, England england)
{
super(s);
this.display = display;
this.england = england;
this.append("排名-队名-场次-胜-平-负-进球-失球-净胜球-积分");
errorAlert = new Alert("ERROR", "连接网络失败 ", null, AlertType.ERROR);
errorAlert.setTimeout(1000);
this.initList();
this.backCommand = new Command("返回", Command.BACK, 2);
this.addCommand(backCommand);
this.setCommandListener(this);
}
/*显示菜单界面方法
public void showForm(Display display, TeamMenuList teamMenu) //用来显示界面
{
this.display = display;
this.teamMenu = teamMenu;
this.display.setCurrent(this);
}*/
/*初始化一些球队信息*/
private void initList()
{
String html = "";
/* Thread t = new Thread()
{
public void run()
{ */
try
{
//String parameter = "name=" + nameText.getString() + "&password=" + passwordText.getString();
//获得服务器用户保存的内容
html = ConnectHttp.invokeJSP(WebServerURL.getURL() + "football/england_team_point.jsp");
//处理HTML标记语言
html = DisposeHTML.getBody(html);
html = Unicode.unicodeToString(html);
}
catch(IOException e)
{
this.display.setCurrent(errorAlert);
System.out.println(e);
}
/* }
};
t.start();*/ //启动线程让它进行连网
String bufferstr = html.trim();//去除空格
bufferstr = Unicode.unicodeToString(bufferstr); //处理中文问题
int j = 0;
while(true) //处理从网络上获得的数据并对其进行处理
{
j = bufferstr.indexOf("~");
if (j == -1)
{
break;
}
this.append(bufferstr.substring(0, j));
bufferstr = bufferstr.substring(j + 1, bufferstr.length());
}
}
public void commandAction(Command c, Displayable s)
{
if(c == backCommand)
{
this.display.setCurrent(england);
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -