import javax microedition lcdui import javax microedition midlet MIDle

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
import javax.microedition.lcdui.*;
import javax.microedition.midlet.MIDlet;
public class Banking extends MIDlet {
private Languages lang = new Languages();
private final String menu[] = {lang.getWord(0), lang.getWord(1)};
private final Command commands[] = {
new Command("Выход", Command.EXIT, 0), //0
new Command("Выбор", Command.OK, 1) //1
};
private String settings_menu[];
public Banking() {
lang = new Languages();
lang.language = "ru"; //temporarily
}
public void startApp() {
Display.getDisplay(this).setCurrent(new Splash());
try {
Thread.sleep(1000);
} catch (InterruptedException ex) {
ex.printStackTrace();
}
Display.getDisplay(this).setCurrent(selectLanguage());
}
private List selectLanguage(){
List LangList = new List(lang.getWord(11), List.IMPLICIT);
for(int i = 0; i < lang.getSupportedLanguages().length; i++)
LangList.append(lang.getSupportedLanguages()[i], null);
LangList.addCommand(commands[0]);
LangList.addCommand(commands[1]);
LangList.setCommandListener(new CommandListener() {
public void commandAction(Command c, Displayable d) {
if(c == commands[0])
destroyApp(true);
if(c == commands[1]){
switch(LangList.getSelectedIndex()) { //не пашет :(
}
}
}
});
return LangList;
}
public void pauseApp() {
}
public void destroyApp(boolean unconditional) {
notifyDestroyed();
}
}