Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
- import javax.microedition.lcdui.Alert;
- import javax.microedition.lcdui.AlertType;
- import javax.microedition.lcdui.Command;
- import javax.microedition.lcdui.CommandListener;
- import javax.microedition.lcdui.Display;
- import javax.microedition.lcdui.Displayable;
- import javax.microedition.lcdui.Form;
- import javax.microedition.lcdui.StringItem;
- import javax.microedition.midlet.*;
- /**
- * @author Łukasz
- */
- public class hello_midlet extends MIDlet implements CommandListener {
- private Form myForm;
- private Display myDisplay;
- private StringItem myString;
- private Command myExit;
- private Command Vypis;
- private Alert myAlert;
- public void initialize()
- {
- myForm = new Form("Ahoj");
- myString = new StringItem("Ahoj svete", "vitej u nas");
- myExit = new Command("Konec", Command.EXIT, 0);
- Vypis = new Command("Vypis", Command.OK, 0);
- myAlert = new Alert("Tea Time");
- }
- public void startApp() {
- initialize();
- myDisplay = Display.getDisplay(this);
- myDisplay.setCurrent(myForm);
- myForm.append(myString);
- myForm.append("Dnes je ctvrtek");
- myForm.addCommand(myExit);
- myForm.setCommandListener(this);
- myForm.addCommand(Vypis);
- myAlert.setTimeout(Alert.FOREVER);
- myAlert.setType(AlertType.ALARM);
- myAlert.setString("ERROR");
- }
- public void pauseApp() {
- }
- public void destroyApp(boolean unconditional) {
- }
- public void commandAction(Command c, Displayable d) {
- if( c == myExit)
- {
- notifyDestroyed();
- // myForm.append("aaaaaa");
- }
- else if( c == Vypis)
- {
- myForm.append("aaaaaaa");
- }
- }
- }
Add Comment
Please, Sign In to add comment