Java Reference
In-Depth Information
return cannotAddLocationAlert;
}
public Command get_settingCommand() {
if (settingCommand == null) {
settingCommand = new Command("Settings", Command.OK, 1);
}
return settingCommand;
}
public Command get_okCommand() {
if (okCommand == null) {
okCommand = new Command("OK", Command.OK, 1);
}
return okCommand;
}
public Command get_exitCommand() {
if (exitCommand == null) {
exitCommand = new Command("Exit", Command.EXIT, 1);
}
return exitCommand;
}
public Command get_screenCommand() {
if (screenCommand == null) {
screenCommand = new Command("Add Location", Command.SCREEN, 1);
}
return screenCommand;
}
public Command get_backCommand() {
if (backCommand == null) {
backCommand = new Command("Back", Command.BACK, 1);
}
return backCommand;
}
}
Looking at the code and comparing it with the implementation from the previous
chapter, you have a minimal number of changes to make. The most important change is
the replacement of the Vector used to store the list of locations; this is now the job of a
LocationStore instance, created by the MIDlet's initialize method. After opening the
 
Search WWH ::




Custom Search