Results 1 to 4 of 4
  1. #1
    bayan is offline Member
    Join Date
    Apr 2010
    Posts
    55
    Rep Power
    0

    Default Solved: Managing directories with java

    I want to create a file explorer window for the "open" option for the file menu in java. Well I know most of it but I don't know how to actually manage a directory programmatically through java.

    What I need to know to finish it is:

    What is the directory object for java(Like the File object for files)? If it doesnt work like that how do you access a directory?

    I guess I can figure out the rest from javadoc but just in case

    How do you return the contents of a directory?

    Thats it for now, any help very much appreciated.
    Last edited by bayan; 07-26-2010 at 05:12 PM.

  2. #2
    PhHein's Avatar
    PhHein is offline Senior Member
    Join Date
    Apr 2009
    Location
    Germany
    Posts
    1,430
    Rep Power
    6

    Default

    A directory in the file system is a java.io.File object. Read the File API docs, especially the isDirectory() and listFiles methods.
    Math problems? Call 1-800-[(10x)(13i)^2]-[sin(xy)/2.362x]
    The Ubiquitous Newbie Tips

  3. #3
    bayan is offline Member
    Join Date
    Apr 2010
    Posts
    55
    Rep Power
    0

    Default

    Oh...... so simple..... well thanks a lot man appreciate it.

  4. #4
    PhHein's Avatar
    PhHein is offline Senior Member
    Join Date
    Apr 2009
    Location
    Germany
    Posts
    1,430
    Rep Power
    6

Similar Threads

  1. Directories
    By KevMeistr in forum New To Java
    Replies: 6
    Last Post: 06-11-2008, 04:03 PM
  2. Managing Gigabytes for Java 2.1.1
    By JavaBean in forum Java Software
    Replies: 0
    Last Post: 03-01-2008, 10:23 PM
  3. Replies: 8
    Last Post: 01-07-2008, 05:41 AM
  4. Managing Gigabytes for Java 2.0
    By JavaBean in forum Java Software
    Replies: 0
    Last Post: 07-07-2007, 02:27 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •