Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

mulitple file selection using JFileChooser problem

 
seema prakash
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have written an ActionListner for a Jbutton to choose mutiple files using JFileChooser and print the file name. I am able to make it work on single file selection , but having problems on multiple selection. Please help.

The code is as given below
 
Pavan Panduga
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think you have to set this property before showing the dialog.
Otherwise, it would already have defaulted while opening the dialog and hence no effect.
fileDialog.setMultiSelectionEnabled(true);
int option = fileDialog.showOpenDialog(null);
 
seema prakash
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot Pavan, I got it working now !
 
My, my, aren't you a big fella. Here, have a tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!