File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JFileChooser

 
Jude Fawly
Ranch Hand
Posts: 33
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,

how can i limit the jfilechooser to search only in a specific folder nothing more?

thanks.
 
Michael Dunn
Ranch Hand
Posts: 4632
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you can hide/disable the navigation buttons and the combobox, but subfolders
will show.

might be easier to use a JList populated with listFiles() filtered by isFile()
 
Paul Clapham
Sheriff
Pie
Posts: 20209
26
MySQL Database
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you tried providing it with a FileFilter that only accepts files (not subdirectories) in that directory?
 
Michael Dunn
Ranch Hand
Posts: 4632
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Doc,

yep, that works - didn't even cross my mind (a short trip!)
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic