Help needed on multiple filechooser, thanks!

D

dota

Hi,
I tryed to use JFileChooser to open multiple files by using
"getSelectedFiles" (Java version 1.3.1). It works but the results are
saved as an arrayed class java.io.File[]. This is very different from
that of "getSelectedFile", for which I can add .getName to get the
file name easily.

My question is how can I get the filenames as a string array from
"getSelectedFiles". Any comments are highly welcomed! Thanks a lot.

DOTA
 
N

nos

dota said:
Hi,
I tryed to use JFileChooser to open multiple files by using
"getSelectedFiles" (Java version 1.3.1). It works but the results are
saved as an arrayed class java.io.File[]. This is very different from
that of "getSelectedFile", for which I can add .getName to get the
file name easily.

My question is how can I get the filenames as a string array from
"getSelectedFiles". Any comments are highly welcomed! Thanks a lot.

DOTA
put this in a loop
String fname = f.getName()
 
D

dota

nos said:
dota said:
Hi,
I tryed to use JFileChooser to open multiple files by using
"getSelectedFiles" (Java version 1.3.1). It works but the results are
saved as an arrayed class java.io.File[]. This is very different from
that of "getSelectedFile", for which I can add .getName to get the
file name easily.

My question is how can I get the filenames as a string array from
"getSelectedFiles". Any comments are highly welcomed! Thanks a lot.

DOTA
put this in a loop
String fname = f.getName()


Thanks a lot!!!
 

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,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top