• Post Reply Bookmark Topic Watch Topic
  • New Topic

List of Files

 
Shane Roylance
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
Is it possible to get a list of files with a certain extension in the current working directory. I was thinking I could use JFileChooser in some way without the GUI, but I couldn't figure it out
Any help would be greatly appreciated
Shane
 
Jason Kretzer
Ranch Hand
Posts: 280
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Look in the File API. There is a method list() or listFiles() that takes a filename filter as an argument.
HTH,
 
Shane Roylance
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you, this is how I got it to work:
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!