• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

browse folder(complete) in java swings

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Rancher
Posts: 3324
32
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I guess you are looking for the File.list(...) method.
 
Bartender
Posts: 11497
19
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Swings!=Swing
SwingIsAProperNoun

...and Welcome to the Ranch
 
Sheriff
Posts: 22783
131
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 22783
131
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic