?? highscoreform.java
字號(hào):
package russiandiamand;
import javax.microedition.lcdui.*;
public class HighScoreForm
extends Form
implements CommandListener
{
StringItem highScoreStringItem;
private Command okCommand = new Command("確認(rèn)", Command.SCREEN, 1);
/** Constructor */
public HighScoreForm()
{
super("高分");
try
{
jbInit();
}
catch (Exception e)
{
e.printStackTrace();
}
}
/**
* Component initialization
* @throws java.lang.Exception
*/
private void jbInit() throws Exception
{
// Set up this Displayable to listen to command events
highScoreStringItem = new StringItem("", "");
highScoreStringItem.setLabel("高分");
highScoreStringItem.setText("0");
setCommandListener(this);
// add the Exit command
addCommand(okCommand);
this.append(highScoreStringItem);
}
public void setScore(String score)
{
highScoreStringItem.setText(score);
}
public String getScore()
{
return highScoreStringItem.getText();
}
/**
* Handle command events
* @param command command
* @param displayable displayable
*/
public void commandAction(Command command, Displayable displayable)
{
if (command == okCommand)
{
DiamandMIDlet.display.setCurrent(DiamandMIDlet.diamandCanvas);
}
}
}
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -