📄 highscoreform.java
字号:
package russiandiamand;
import javax.microedition.lcdui.*;
public class HighScoreForm
extends Form
implements CommandListener
{
StringItem highScoreStringItem;
private Command okCommand = new Command("确认", 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);
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -