public void startApp() { textBox = new TextBox("Ophone", "\n", 512, TextField.UNEDITABLE); OxportMIDlet.addtext("Listo para exportar servicios..."); textBox.addCommand(exitCom); textBox.addCommand(playCom); textBox.addCommand(initCom); textBox.setCommandListener(this); display.setCurrent(textBox); }
public void commandAction(Command c, Displayable s) { if (c == exitCom) { destroyApp(true); notifyDestroyed(); } else if (c == initCom) { if (ox == null) { textBox.insert("Exportando...\n", textBox.size()); ox = new Oxport(); ox.start(); } } else if (c == playCom) { if ((ox == null) || (ox.getOServer() == null)) addtext("Playground need a OServer running"); else { if (playground == null) playground = new PlayGround(this); display.setCurrent(playground); } } else { } }
public static void addtext(String text) { if (textBox != null) textBox.insert(text + "\n", textBox.size()); }