Problem with deleteAll() method of Form object. (J2ME)

  • Thread starter =?ISO-8859-1?Q?Alejandro_Rodr=EDguez_Gonz=E1lez?=
  • Start date
?

=?ISO-8859-1?Q?Alejandro_Rodr=EDguez_Gonz=E1lez?=

Hello,

In first place, sorry for my english :)

I'm developing a J2ME application. One of the class of this applications
extends Canvas and implements CommandListener. In this class, i have a
Form object like this:

Form pantalla = new Form("Contacto");

I add to this form some Command and TextField, and later, i want to
delete all items of the Form, and i use pantalla.deleteAll();

The problem is, that this method, sometimes delete all the elements of
the form, but, in other times, don't do it. Concretely, the Command
items, don't delete. Why? Exists other way to delete this Command?

Thanks.
 
D

Darryl Pierce

Alejandro said:
The problem is, that this method, sometimes delete all the elements of
the form, but, in other times, don't do it. Concretely, the Command
items, don't delete. Why?

Because Form.deleteAll() removes all instances of
javax.microedition.lcdui.Item from the Form (as the API documentation
says). javax.microedition.lcdui.Command objects are not Items so they
are not removed.
Exists other way to delete this Command?

javax.microedition.lcdui.Form.remove(Command)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,072
Latest member
trafficcone

Latest Threads

Top