Skip to content

Commit

Permalink
Show directories first in File Picker
Browse files Browse the repository at this point in the history
  • Loading branch information
kairusds committed Oct 17, 2024
1 parent cf48ecc commit c78ed8e
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,14 @@ private void showFilePickerDialog(File dir){
Arrays.sort(files, new Comparator<File>(){
@Override
public int compare(File f1, File f2){
if(f1.isDirectory() && !f2.isDirectory()){
return -1;
}

if(!f1.isDirectory() && f2.isDirectory()){
return 1;
}

String name1 = f1.getName();
String name2 = f2.getName();

Expand Down

0 comments on commit c78ed8e

Please sign in to comment.