#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2001
    Posts
    15
    Rep Power
    0

    Question Getting the filelist ordered by name?


    Hi, All!

    How do I make java.io.File return the filelist in a specific order?

    This is the code:
    File fileDirectory = new File("c:/temp/");
    String[] sfilelist = fileDirectory.list();

    Now the list(String array) comes in this order:
    picture1.jpg
    picture10.jpg
    picture2.jpg

    ...but I wan't it to be like this:
    picture1.jpg
    picture2.jpg
    picture10.jpg

    ...or can I sort the array of string in some way?

    Thankful for any help.

    /PsykBryt

    PS. I'm using Win2000
  2. #2
  3. No Profile Picture
    Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2002
    Location
    India
    Posts
    7
    Rep Power
    0
    hi,
    the list is already sorted alphabetically...if u want to change the order then u prob shud write ur own program....

IMN logo majestic logo threadwatch logo seochat tools logo