question about j2me Vector

S

sang park

Hi all, i'm really new to the world of J2ME and have a couple of
questions that I'm hoping someone could help me with.

My first question is about the java.util.Vector class. I noticed that
not all methods are implemented in J2ME. namely add(Object obj). BUt
you can work around this with addElement(Object obj) with little
problems. But my question is how to clear the Vector. The J2SE
version of Vector has a clear() method, but there doesn't seem to be a
corresponding method or alternative. Can someone tell me how to clear
a Vector in J2ME? Also, does anyone know the location of the javadocs
for the J2ME version of the classes?

My next question is about executing other programs. I have urls on
several different screens in my application and would like to know how
to make it so that when clicked on (or a Command action), to open the
device's browser (if it has one) and connect to the url in question.

For instance, my screen may have a url like http://www.nytimes.com, I
would like to open the browser and connect to that url.

any help would be greatly appreciated.

s.park
 
D

DigiAl

My next question is about executing other programs. I have urls on
several different screens in my application and would like to know how
to make it so that when clicked on (or a Command action), to open the
device's browser (if it has one) and connect to the url in question.

For instance, my screen may have a url like http://www.nytimes.com, I
would like to open the browser and connect to that url.


If you are deploying to MIDP 2.0 devices you can use the MIDlet class's
platformRequest(String) method to ask to open a url

alan.
 
T

Timo Kinnunen

vector.setSize(0);

Or vector.removeAllElements();

Javadocs can be found from the JSR-000037 Mobile Information Device Profile
(MIDP) (Final Release) specification.
 
S

sang park

Thanks for your responses! Another similar and silly question. After
looking at the javadoc for javax.microedition.lcdui.List, I can't seem
to find a "clear()" method there either. What is the best way to
clear the elements in a List?

Thanks again for all your help.

s.park
 
J

JScoobyCed

sang park said:
Thanks for your responses! Another similar and silly question. After
looking at the javadoc for javax.microedition.lcdui.List, I can't seem
to find a "clear()" method there either. What is the best way to
clear the elements in a List?

List.deleteAll();

Note for further question: to remove the elements of an object, there is no
particular keyword to look for. It can be removeAll(), deleteAll(), clear(),
unsetAll(), setSize(0), dropAll(), empty(), .... Just read the full list of
method in the API doc of the objct you want to reset ( ... reset() is also
one :) ). Especially in J2ME, there isn't much method per class. Don't
forget to look for superclass methods too.
I just say that to save your time.

JScoobyCed
-------------
 

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

Forum statistics

Threads
473,774
Messages
2,569,598
Members
45,151
Latest member
JaclynMarl
Top