Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

mulitple file selection using JFileChooser problem  RSS feed

 
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 !
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!