Saturday, February 20, 2010

Other Displayable Objects

Since I had a great deal of work i couldn't write this blog last few days. Today we'll look in to other displayable objects which we discussed earlier. This is just to let you guys know about these displayable objects. After this we'll go in to Commands which I will have to explain a lot (I think).
Ok since you have your FirstMidlet class you can comment out these lines

Alert alert = new Alert("Alert");
alert.setString("Hello World");
Display.getDisplay(this).setCurrent(alert);

and put this one and try:

TextBox tb = new TextBox("Text", "", 1000, TextField.ANY);/*Try changing TextField.ANY to other options as well*/
Display.getDisplay(this).setCurrent(tb);

now comment above and try this:

/*There are 3 types of list you can check them out by changing List.EXCLUSIVE to List.IMPLICIT n List.MULTIPLE*/
List lst = new List("List", List.EXCLUSIVE);
Display.getDisplay(this).setCurrent(lst);

lastly try this one:

Form frm = new Form("Form");
TextField tf = new TextField("Text Field", "", 100, TextField.PHONENUMBER);/*You can use ANY or others as well but I used this one because this is the way to access your phonebook through a textfiled*/
DateField df = new DateField("Date Field", DateField.DATE_TIME);
StringItem si = new StringItem("String", "");
si.setText("This is string item");
frm.append(tf);
frm.append(df);
frm.append(si);
Display.getDisplay(this).setCurrent(frm);

Ok now this settles it. Now it's time to get into real business with commands.

No comments:

Post a Comment