JBList<SearchResult> () { CollectionListModel<SearchResult> model = new CollectionListModel<>(); JBList<SearchResult> list = new JBList<>(model); list.addListSelectionListener(new CloseSearchResultsListSelectionListener(list)); return list; }