File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Swing / AWT / SWT / JFace and the fly likes slecting mutiple files in  a FileDialog (Urgent) Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT / JFace
Reply Bookmark "slecting mutiple files in  a FileDialog (Urgent)" Watch "slecting mutiple files in  a FileDialog (Urgent)" New topic
Author

slecting mutiple files in a FileDialog (Urgent)

netharam ram
Ranch Hand

Joined: Aug 09, 2001
Posts: 202
Hi,I just want to open a FileDialog to select more than one file at a time.For eg. in winamp to add mp3 files to the playlist we are able to select even all files of the folder.I want to select some or all files of a folder and add it to a listbox.Again to choose directory as in winamp to add Directory to the playlist I want to add all files of a specific folder using select directory.Please reply as soon as possible
Paul Stevens
Ranch Hand

Joined: May 17, 2001
Posts: 2823
setMultiSelectionEnabled(true). The API is a wonderful thing.
netharam ram
Ranch Hand

Joined: Aug 09, 2001
Posts: 202
Sorry Paul, I couldn't find the methos setMultiSelectionEnabled(true) in FileDialog class.So please be sharp in what u reply,inform me of where the method is.
-Netharam
Nathan Pruett
Bartender

Joined: Oct 18, 2000
Posts: 4120

Not a suprise that you didn't find it... setMultiSelectionEnabled() is a method of JFileChooser... the Swing version of the AWT FileDialog...

My suggestion is to use Swing instead of AWT since it already supports what you want to do, and since you are dealing with a file dialog, you shouldn't have to use AWT for any reason ( like applets... ), you shouldn't have a problem with it...

If you have to use AWT for some reason, you're going to have to extend FileDialog to add this capability... I'd look in the jar file that contains the java source of FileDialog to see what they are doing to see what you need to change...

-Nate


-Nate
Write once, run anywhere, because there's nowhere to hide! - /. A.C.
netharam ram
Ranch Hand

Joined: Aug 09, 2001
Posts: 202
Thank You Nate,I'm already using swing in my application,but went for AWT for File Dialogs.Let me work fully with Swing.Thank you
netharam ram
Ranch Hand

Joined: Aug 09, 2001
Posts: 202
Thank you Nate.I'm already using swing in my application,but used AWT only for FileDialog,u have reminded me of JFileChooser.So let me use Swing fully in my application.
Thank you
--netharam--
Gregg Bolinger
Sheriff

Joined: Jul 11, 2001
Posts: 15040

Hi Netharam
I wonder if your question has even been addressed. Setting multiSelect to true is good, if you want to choose more than one file at a time. but don't you want to choose a Folder that is full of the files you want to choose? I would like to know how to do that as well. But if just selecting a list of files works for your purpose, then good deal.
Just wanted to know if your question really got answered and was understood.
Thanks

------------------
Happy Coding,
Gregg Bolinger


My Blog | DZone Articles
 
 
subject: slecting mutiple files in a FileDialog (Urgent)
 
Threads others viewed
FileDialog
Getting the "Tree View" Dialog Box
Selecting Directory using Dialog box
How to set the filter for a Save File Dialog for Folders?
FileDialog for multiple file selection
IntelliJ Java IDE