Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

browse folder(complete) in java swings  RSS feed

 
Rishabh Rathi
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Everbody.


I am new to this forum and also new to JAVA.
I am working on a project using which a folder can be compressed and decompressed.
But the very first problem i get is i am not able to browse complete folder.
Please help me out.
 
Rob Camick
Ranch Hand
Posts: 2753
11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I guess you are looking for the File.list(...) method.
 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Swings!=Swing
SwingIsAProperNoun

...and Welcome to the Ranch
 
Rob Spoor
Sheriff
Posts: 20893
81
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Rob Camick wrote:I guess you are looking for the File.list(...) method.

And otherwise for JFileChooser.
 
Rishabh Rathi
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you all 4 for your reply.....but i still not get my answer as i want to know how to browse for complete folder rather than single file....


JFileChooser() is for choosing a file not a folder
 
Rishabh Rathi
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

@Rob:

Will you please give an example of code so that i can get it more easily?
 
Rob Spoor
Sheriff
Posts: 20893
81
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Rishabh Rathi wrote:Thank you all 4 for your reply.....

Sorry to nitpick, but UseRealWords: "for", not "4".

JFileChooser() is for choosing a file not a folder

Not if you set the file selection mode to JFileChooser.DIRECTORIES_ONLY or JFileChooser.FILES_AND_DIRECTORIES; the default is JFileChooser.FILES_ONLY.

Rishabh Rathi wrote:
@Rob:

Will you please give an example of code so that i can get it more easily?

If you click on the JFileChooser words around this thread you will open up its Javadoc page. At the top there's a link with label "How to Use File Choosers". Click on it and read the page you're redirected to.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!