Wednesday, August 6, 2008

Bigger TextField in J2ME application [Source Code]

import javax.microedition.midlet.MIDlet;
import javax.microedition.lcdui.*;

public class TextFieldTest extends MIDlet implements CommandListener {
private Display display;
private Form form;
private Command exitCommand;
private TextField text1;

public void startApp() {
display=Display.getDisplay(this);
form=new Form("");
text1=new TextField("","",50,TextField.ANY);
text1.setPreferredSize(100,200);
form.append(text1);
exitCommand=new Command("Exit",Command.EXIT,0);
form.addCommand(exitCommand);
form.setCommandListener(this);
display.setCurrent(form);
}

protected void pauseApp() {
}

protected void destroyApp(boolean arg0) {
}

public void commandAction(Command c, Displayable s) {
if (c == exitCommand) {
destroyApp(true);
notifyDestroyed();
}
}

}

No comments:

search engine

Custom Search