?? description.java
字號:
import javax.microedition.lcdui.*;
import java.io.*;
import java.util.*;
import util.ParseXML;
public class Description extends Alert
{
private Command comdBack = new Command("返回",Command.BACK,1);
private String imagePath = "";
private String content = "";
public Description()
{
super("游戲說明");
this.addCommand(comdBack);
this.setTimeout(Alert.FOREVER);
/* parser Description.xml */
parse();
/* load alert image */
try
{
if( !"".equals(imagePath) )
{
Image image = Image.createImage(imagePath);
this.setImage(image);
}
}catch(IOException e)
{
System.out.println(e);
}
/* load description content */
setString(content);
/* set font */
}
private void parse()
{
InputStream inputStream = null;
try
{
inputStream = this.getClass().getResourceAsStream("/Description.xml");
ParseXML parseXml = new ParseXML(inputStream);
if(null != parseXml.get("Description"))
{
imagePath = (String)((Hashtable)parseXml.get("Description")).get("Image");
content = (String)((Hashtable)parseXml.get("Description")).get("Desc");
}
} catch(Exception e) {
System.out.println("Load Description.xml error");
}
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -