A J2ME tip illustrating a method of adding strings to a form. The first four append( ) calls add text strings to the Form. The top line of the screen holds the two separate items "Hello" and "World", which will be laid out horizontally because they are string items. The next item to be added begins and ends with newline characters.

Form form = new Form("Item Layout");

form.append("\nLet's start\na new line\n");
form.append("This is quite a long string that may not fit on one line");
form.append(new TextField("Name", "J. Doe", 32, TextField.ANY));
form.append(new TextField(null, null, 32, TextField.ANY));



 Related Tips