From 75109d14435f07d3ef4245e0d75484ce88f033a6 Mon Sep 17 00:00:00 2001 From: Jan Eglinger Date: Fri, 8 Apr 2022 22:01:00 +0200 Subject: [PATCH] File widgets: sort list in drag-and-drop operation --- src/main/java/org/scijava/ui/swing/widget/SwingFileWidget.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/java/org/scijava/ui/swing/widget/SwingFileWidget.java b/src/main/java/org/scijava/ui/swing/widget/SwingFileWidget.java index 2565e16..b427407 100644 --- a/src/main/java/org/scijava/ui/swing/widget/SwingFileWidget.java +++ b/src/main/java/org/scijava/ui/swing/widget/SwingFileWidget.java @@ -39,6 +39,7 @@ import java.io.IOException; import java.util.ArrayList; import java.util.Arrays; +import java.util.Collections; import java.util.List; import java.util.stream.Collectors; @@ -280,6 +281,7 @@ public static List getFiles( } @SuppressWarnings({ "unchecked", "cast" }) List listOfFiles = (List) list; + Collections.sort(listOfFiles); return listOfFiles; } catch (final UnsupportedFlavorException | IOException exc) {