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
posted
0
setMultiSelectionEnabled(true). The API is a wonderful thing.
netharam ram
Ranch Hand
Joined: Aug 09, 2001
Posts: 202
posted
0
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
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
posted
0
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
posted
0
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--
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