From bd84a831f507cd77a222124ec13a825f531d33f4 Mon Sep 17 00:00:00 2001 From: William Schaefer Date: Tue, 16 Jul 2019 17:56:33 -0400 Subject: [PATCH] 5114 make first group selected by default --- Core/src/org/sleuthkit/autopsy/filequery/GroupListPanel.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Core/src/org/sleuthkit/autopsy/filequery/GroupListPanel.java b/Core/src/org/sleuthkit/autopsy/filequery/GroupListPanel.java index 2b62a41a65..18b5950025 100644 --- a/Core/src/org/sleuthkit/autopsy/filequery/GroupListPanel.java +++ b/Core/src/org/sleuthkit/autopsy/filequery/GroupListPanel.java @@ -45,7 +45,7 @@ class GroupListPanel extends javax.swing.JPanel { results = new LinkedHashMap<>(); groupList.setListData(new String[0]); } - + @Subscribe void handleSearchCompleteEvent(DiscoveryEvents.SearchCompleteEvent searchCompleteEvent) { try { @@ -53,6 +53,9 @@ class GroupListPanel extends javax.swing.JPanel { results = searchCompleteEvent.getSearchResults().toLinkedHashMap(); Set resultsKeySet = results.keySet(); groupList.setListData(resultsKeySet.toArray(new String[results.size()])); + if (groupList.getModel().getSize() > 0) { + groupList.setSelectedIndex(0); + } validate(); repaint(); } catch (FileSearchException ex) {