📄 deleterecordstoremidlet.java
字号:
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
import javax.microedition.rms.*;
// A first MIDlet with simple text and a few commands.
public class deleteRecordStoreMIDlet extends MIDlet
implements CommandListener {
private Command exitCommand;
private Command confirmCommand;
//The display for this MIDlet
private Display display;
public deleteRecordStoreMIDlet() {
display = Display.getDisplay(this);
exitCommand = new Command("离开", Command.EXIT, 1);
confirmCommand = new Command("删除",Command.OK,1);
}
// Start the MIDlet by creating the TextBox and
// associating the exit command and listener.
public void startApp() {
TextBox aTextBox = new TextBox("主画面","删除RecordStore",256,TextField.ANY);
aTextBox.addCommand(exitCommand);
aTextBox.addCommand(confirmCommand);
aTextBox.setCommandListener(this);
display.setCurrent(aTextBox);
}
// Pause is a no-op because there are no background
// activities or record stores to be closed.
public void pauseApp() { }
// Destroy must cleanup everything not handled
// by the garbage collector.
// In this case there is nothing to cleanup.
public void destroyApp(boolean unconditional) { }
public void commandAction(Command c, Displayable s) {
if(c.getCommandType() == Command.EXIT){
destroyApp(false);
notifyDestroyed();
}
else{
try{
RecordStore.deleteRecordStore("aRS");
}
catch(Exception e){
}
System.out.println("delete ok");
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -