• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

slecting mutiple files in a FileDialog (Urgent)

 
Ranch Hand
Posts: 202
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 2823
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Bartender
Posts: 4121
IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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--
 
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
reply
    Bookmark Topic Watch Topic
  • New Topic