-
Notifications
You must be signed in to change notification settings - Fork 0
/
HelloWorld.java
46 lines (37 loc) · 1003 Bytes
/
HelloWorld.java
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
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
/**
* @author Catur Andi Pamungkas
* @date 21/04/2017
*/
public class HelloWorld extends MIDlet implements CommandListener{
Display display;
Command commandExit;
Alert alertHallo;
Ticker tickerText;
public HelloWorld(){
commandExit = new Command("Exit",Command.EXIT,0);
alertHallo = new Alert("Hallo Alert","Belajar JAVA J2ME (Micro Edition)",null,AlertType.INFO);
tickerText = new Ticker("BELAJAR JAVA J2ME EDITION");
alertHallo.setCommandListener(this);
alertHallo.addCommand(commandExit);
alertHallo.setTicker(tickerText);
alertHallo.setTimeout(Alert.FOREVER);
}
public void startApp(){
if(display == null){
display = Display.getDisplay(this);
}
display.setCurrent(alertHallo);
}
public void pauseApp(){
}
public void destroyApp(boolean unconditional){
}
public void commandAction(Command c, Displayable d){
if(c == commandExit){
destroyApp(true);
notifyDestroyed();
}
}
}