JFileChooser in J2ME

H

- HAL9000

I am writing a J2ME application and need to choose/select files on a
network drive. My understanding is that I cannot use JFileChooser
since J2ME doesn't support Swing. Is my understanding correct?

Also if the above is true, can anyone recommend a web page to guide me
in implementing the equivalent of JFileChooser using awt components?

Thanks for your help,
Forrest
 
A

Andrew Thompson

...
Also if the above is true, can anyone recommend a web page to guide me
in implementing the equivalent of JFileChooser using awt components?

java.awt.FileDialog
 
D

Darryl L. Pierce

- HAL9000 said:
I am writing a J2ME application and need to choose/select files on a
network drive. My understanding is that I cannot use JFileChooser
since J2ME doesn't support Swing. Is my understanding correct?
Correct.

Also if the above is true, can anyone recommend a web page to guide me
in implementing the equivalent of JFileChooser using awt components?

You can't. Since there's no such thing as a file system on most MIDs
(Mobile Internet Devices) there's no way to browse a file system. However,
on devices that *do* support the concept of a file system, Sun already has
available the optional PIM APIs which includes the File System API set.
 
H

- HAL9000

Gosh, I'm real new to all this.

The specific hardware is a Sharp Zaurus. I guess I will be using a
"Personal Profile" instead of MIDP? Looks like Personal Profile
supports an abbreviated AWT. Do yo know off hand if FileDialog is
included?

Thanks,

Forrest
 
A

Andrew Thompson

Darryl L. Pierce said:
Andrew Thompson wrote: ....

Nope. He was asking for the MIDP, and the AWT is definitely *not* a part of
the MIDP.

Dang! That damn, 'read the question carefully'
thing _again_!

Soon as I saw AWT and JFileChooser I
stopped thinking. (..ehhh, shrugs)

;-)
 
D

Darryl L. Pierce

- HAL9000 said:
Gosh, I'm real new to all this.

The specific hardware is a Sharp Zaurus. I guess I will be using a
"Personal Profile" instead of MIDP?

No, you won't be using that, unless you port the Personal Profile over to
Zaurus. Perhaps it's been done already, but not that I've heard.
Looks like Personal Profile
supports an abbreviated AWT. Do yo know off hand if FileDialog is
included?

Yes, java.awt.FileDialog is included in the Personal Profile.
 
B

Ben Jessel

You can't. Since there's no such thing as a file system on most MIDs
(Mobile Internet Devices) there's no way to browse a file system. However,
on devices that *do* support the concept of a file system, Sun already has
available the optional PIM APIs which includes the File System API set.

Alternatively, use the device specific java API's that come with the
phone. Could you accomplish what you need to do with recordsets? On
most devices this is what is used for persistant storage.
 
D

Darryl L. Pierce

Ben said:
Alternatively, use the device specific java API's that come with the
phone.

This assumes that such APIs exist, and ignores that doing so creates a
MIDlet suite that cannot be ported to another platform. Additionally, it
assumes that the phone *has* a file system (something most phones do not
have) or that the phone supports the required protocols for doing network
directory browsing (which is a bad assumption to make).
 
H

- HAL9000

Thanks Darryl, I'll check into Zaurus having a Personal Profile. I
guess a console interface would be the way to go without it...

Forrest
 
D

Darryl L. Pierce

- HAL9000 said:
Thanks Darryl, I'll check into Zaurus having a Personal Profile. I
guess a console interface would be the way to go without it...

The MIDP doesn't support such a thing as a console application. It's
interface is via the LCDUI.
 

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,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top