placeincompetition.java
来自「手机拼图游戏:J2ME游戏」· Java 代码 · 共 115 行
JAVA
115 行
/**
* Created by IntelliJ IDEA.
* User: robai
* Date: 2007-2-25
* Time: 13:06:27
* To change this template use File | Settings | File Templates.
*/
import util.ParseXML;
import javax.microedition.lcdui.*;
import javax.microedition.rms.RecordStore;
import javax.microedition.rms.RecordEnumeration;
import java.io.IOException;
import java.io.InputStream;
import java.util.Hashtable;
public class PlaceInCompetition extends Alert
{
public static Command comdBack = new Command("返回",Command.BACK,1);
public static String TITLE = "最高记录...";
private String levelName = "";
private String levelNum = "";
public PlaceInCompetition()
{
super(PlaceInCompetition.TITLE);
this.addCommand(comdBack);
this.setTimeout(Alert.FOREVER);
String txt = "";
try
{
Image image = Image.createImage("/img/paiming.jpg");
this.setImage(image);
RecordStore rec = null;
RecordEnumeration en = null;
try
{
rec = RecordStore.openRecordStore(SpellPic.RecordStore_Easy,false);
en = rec.enumerateRecords(null,null,false);
int m=0;
while(en.hasPreviousElement())
{
if(m == 0)
levelName = new String(en.previousRecord());
if(m == 1)
{
levelNum = new String(en.previousRecord());
break;
}
m++;
}
rec.closeRecordStore();
txt += levelName+": 第 "+levelNum+" 关\n";
}catch(Exception e){
txt += SelectLevelMenu.LEVEL_EASY_NAME +": "+"第 0 关\n";
}
try
{
rec = RecordStore.openRecordStore(SpellPic.RecordStore_Normal,false);
en = rec.enumerateRecords(null,null,false);
int m=0;
while(en.hasPreviousElement())
{
if(m == 0)
levelName = new String(en.previousRecord());
if(m == 1)
{
levelNum = new String(en.previousRecord());
break;
}
m++;
}
rec.closeRecordStore();
txt += levelName+": 第 "+levelNum+" 关\n";
}catch(Exception e){
txt += SelectLevelMenu.LEVEL_NORMAL_NAME +": "+"第 0 关\n";
}
try
{
rec = RecordStore.openRecordStore(SpellPic.RecordStore_Difficulty,false);
en = rec.enumerateRecords(null,null,false);
int m=0;
while(en.hasPreviousElement())
{
if(m == 0)
levelName = new String(en.previousRecord());
if(m == 1)
{
levelNum = new String(en.previousRecord());
break;
}
m++;
}
rec.closeRecordStore();
txt += levelName+": 第 "+levelNum+" 关\n";
}catch(Exception e){
txt += SelectLevelMenu.LEVEL_DIFFICULTY_NAME +": "+"第 0 关\n";
}
}catch(Exception e)
{
System.out.println(e);
}
this.setString(txt);
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?