Form form = new Form("Hello World"); String msg = "Hello World!!!!!!!"; form.append(msg); display = Display.getDisplay(this); display.setCurrent(form);
public void startApp(){ display = Display.getDisplay(this); Form form = new Form("Calender"); form.append(calender); display.setCurrent(form); }
img = Image.createImage(data, 0, len); Form f = new Form("Image"); f.append(img); display.setCurrent(f);
Form f = new Form("Please Waite..."); f.append("Please Waite..."); Display.getDisplay(this).setCurrent(f);
Form example = new Form("Example"); TextField test = new TextField("", "", 50, TextField.ANY); example.append(test); display.setCurrent(example);
... Form form=new Form("filename"); InputStream fin=fconn.openDataInputStream(); StringBuffer buf =new StringBuffer(); int c; int counter=-1; while((c=fin.read())!=-1) { counter++; if(counter==23) { form.append(buf.toString()); buf=null;counter=0; continue; } buf.append((char)c); } if(counter<23 && counter>=0) // write the skipped chars between the last number read and the end of file { form.append(buf.toString()); buf=null;counter=0; } fin.close(); ...
public class DateAndTime extends MIDlet implements CommandListener{ private Display disp; private Date d; private DateField currentDate; private Form form; private int index; public DateAndTime(){ form = new Form("Data and Time"); d = new Date(); currentDate = new DateField("", DateField.DATE_TIME); currentDate.setDate(d); } public void startApp(){ index = form.append(currentDate); disp = Display.getDisplay(this); disp.setCurrent(form); } }
public class ChoiceGroup extends MIDlet { Display display=Display.getDisplay(this); public void startApp() { Form form = new Form("Choice Form"); //ChoiceGroup(label,type,elements,image) ChoiceGroup CoursePOP = new ChoiceGroup ("Pop Up choice", Choice.POPUP, new String[] {"India", "Usa","UK"}, null); form.append(CoursePOP); display.setCurrent(form); } }
private Form getForm() { Form form = new Form("test"); ChoiceGroup choice = new ChoiceGroup(null, ChoiceGroup.EXCLUSIVE); choice.append("Male", null); choice.append("Female", null); form.append(choice); this.cmdSelect = new Command("Select", Command.OK, 1); form.addCommand(this.cmdSelect); form.setCommandListener(this); return form; }
formReceiver.append(tfPort); formReceiver.addCommand(cmdListen); formReceiver.addCommand(cmdExit); if (message instanceof TextMessage) { TextMessage tMessage = (TextMessage)message; formReceiver.append("Message received : "+tMessage.getPayloadText()+"\n"); } else { formReceiver.append("Unknown Message received\n");
form.append(textField);
mainForm = new Form ("HelloMidp"); String batt = System.getProperty("batterylevel"); mainForm.append (batt);
display = Display.getDisplay(this); exit = new Command("Exit", Command.EXIT, 1); form.append(imageItem); form.addCommand(exit); form.setCommandListener(this);
dateField.setDate(date); dateForm.append(dateField); final javax.microedition.lcdui.Command acceptCommand = new javax.microedition.lcdui.Command(UIManager.getInstance().localize(OK, OK), javax.microedition.lcdui.Command.OK, 0);
form.addCommand(exit); form.addCommand(submit); form.append(textfield); form.setCommandListener(this);
public static String showInputDialog(final MyCallBack callback) { Form frm = new Form(); final Command cmd = new Command("Ok"); final TextField txt = new TextField("Enter the text", null, 1024, 0); frm.addCommand(cmd); frm.append(txt); frm.setCommandListener(new CommandListener() { public void commandAction(Command c, Displayable d) { if (c == cmd) { return callback.processResult(txt.getString()); } else { return; // or just omit the else part } } }); }