File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Applets and the fly likes A Few Questions Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Applets
Bookmark "A Few Questions" Watch "A Few Questions" New topic

A Few Questions

Matt DeLacey
Ranch Hand

Joined: Oct 12, 2000
Posts: 318
Hey Ranchers--
I have a few questions:
1.) OK, everybody asks how you can access the local file
system from an applet. I've seen this asked it seems
like hundreds of times. It seems clear you can't do this
in an applet unless the applet is signed or you are
using appletviewer and you specify security settings blah
blah blah. But, I've seen it done in several places
on the web. So, I guess they're not using Java, but
how exactly are they doing it?
2.) I want to be able to have a drop down box (I have been
using Choice), but I want the user to to be able to
select multiple items. I tried using CheckboxMenuItem
but I think that can only be used with Frames. I tried
a PopupMenu with a TextField and I could make it all
work but everytime I show() it has the same name as
the parent on all the items in the PopupMenu no matter
what I do. That or it doesn't show the any names. Is
there a way I can accomplish this. A snippet of code
would make you my best friend because I have seen
several descriptions but can't make them work and I
have spent several, several hours on it.
3.) I want a dropdown menu like a choice but I want the
choices to be little icons or pictures or whatever.
I can't see any way to do this but know it's possible.
I can't use swing because it's an applet and I want
it to work on a webpage without requiring the user
have the plugin.
P.S. In case it wasn't clear, I don't want the user to
use swing OR have it just be functional in appletviewer
because I want to actually deploy this on a webpage.
Responses will be rgeatly appreciated and in fact
I will spend several minutes thinking really good thoughts
about anybody who replies. Hey, who couldn't use a little
extra good karma?

With Respect,
Stephanie Grasson
Ranch Hand

Joined: Jun 14, 2000
Posts: 347
Hi Matt!
In order of your questions:
(1) I'm not sure how they are doing it. Do you have an example of a site which does this?
(2) Here is a sample code which does what you asked (shows a popup menu in which the user can select multiple items at the same time):

(3) I haven't tried to show images like you describe without using Swing, but this person had a similar question about showing an image on a button without using Swing, so maybe it will help you:
I hope this helps. (Please let me know if I have qualified to become your new best friend and receive several minutes of good thoughts/good karma).

Matt DeLacey
Ranch Hand

Joined: Oct 12, 2000
Posts: 318
Most assuredly! You should be feeling the warm glow of good thoughts right about....NOW! They should continue for quite sometime.
My Thoughts:
"Stephanie is nice, Stephanie is kind, Stephanie is good,
Stephanie is nice, Stephanie is kind, Stephanie is good,

With Respect,
P.S. Oh yeah, since your my best friend now, it might be a good idea for you to take up beer drinking.
Mindy Wu
Ranch Hand

Joined: Jan 12, 2001
Posts: 121
My answer is to question #2:
You can use JList object to display a serie of item, and allow the user to select multiple choices.
Hope i can help more.

Matt DeLacey
Ranch Hand

Joined: Oct 12, 2000
Posts: 318
Thanks Mindy, but, as I said, I don't want to have to use
Swing as I want to deploy it on the web and I don't want users
to have to have the plugin. But thanks just the same.
With Respect,
Matt DeLacey
I agree. Here's the link:
subject: A Few Questions
It's not a secret anymore!