Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Sorting FileNames  RSS feed

 
Gavin Bonner
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi, me again, todays question is how can i sort my FileNames from a-z in the event of a button click. the files are in the same folder as my application.
Gavin.
 
WarnerJan Veldhuis
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You might wanna checkout the java.util.Collections class, especially the sort() methods
 
Vicken Karaoghlanian
Ranch Hand
Posts: 522
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you have the file names in array of String then you can always sort them using the static method Arrays.sort(Object[]).
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!