void (List<? extends SearchResult> searchResults) { if (searchResults == null || searchResults.isEmpty()) { return; } int oldSelectedIndex = myShowingResultsList.getSelectedIndex(); myResultsListModel.add(searchResults); if (myShowingResultsList.getSelectedIndex() != oldSelectedIndex) { myShowingResultsList.setSelectedIndex(oldSelectedIndex); } }