Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

slecting mutiple files in a FileDialog (Urgent)  RSS feed

 
netharam ram
Ranch Hand
Posts: 202
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2823
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
setMultiSelectionEnabled(true). The API is a wonderful thing.
 
netharam ram
Ranch Hand
Posts: 202
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
netharam ram
Ranch Hand
Posts: 202
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 202
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!