rdfs:comment
| - MIDlet - currCal -> währungsumrechner package currCalc; import javax.microedition.lcdui.*; import javax.microedition.midlet.MIDlet; import javax.microedition.midlet.MIDletStateChangeException; public class CurrCalc extends MIDlet implements CommandListener{ private Display display; private Form form; private Command exit; private Command convert; private Command clear; private TextField curr_1; private TextField curr_2; public CurrCalc() { super(); form = new Form("CurrCalc"); display = Display.getDisplay(this); exit = new Command("EXIT", Command.EXIT, 1); convert = new Command("CONVERT", Command.SCREEN, 1); clear = new Command("CLEAR", Command.STOP, 1); cur
|
abstract
| - MIDlet - currCal -> währungsumrechner package currCalc; import javax.microedition.lcdui.*; import javax.microedition.midlet.MIDlet; import javax.microedition.midlet.MIDletStateChangeException; public class CurrCalc extends MIDlet implements CommandListener{ private Display display; private Form form; private Command exit; private Command convert; private Command clear; private TextField curr_1; private TextField curr_2; public CurrCalc() { super(); form = new Form("CurrCalc"); display = Display.getDisplay(this); exit = new Command("EXIT", Command.EXIT, 1); convert = new Command("CONVERT", Command.SCREEN, 1); clear = new Command("CLEAR", Command.STOP, 1); curr_1 = new TextField("Currency 1","",5,TextField.NUMERIC); curr_2 = new TextField("Currency 2","",5,TextField.NUMERIC); form.addCommand(exit); form.addCommand(convert); form.addCommand(clear); form.append(curr_1); form.append(curr_2); form.setCommandListener(this); } protected void startApp() throws MIDletStateChangeException { display.setCurrent(form); } protected void pauseApp() { } protected void destroyApp(boolean arg0) { } public void commandAction(Command command, Displayable displayable) { if(command == clear) { curr_1.setString(""); curr_2.setString(""); } if(command == convert) { String converted = Integer.toString( Integer.parseInt(curr_1.getString()) * 13); curr_2.setString(converted); } if(command == exit) { destroyApp(false); notifyDestroyed(); } } }
|