Here you can find the source of fireSelectRows(final JList list, final int[] rows)
public static void fireSelectRows(final JList list, final int[] rows)
//package com.java2s; //License from project: Open Source License import java.awt.EventQueue; import javax.swing.JList; public class Main { public static void fireSelectRows(final JList list, final int[] rows) { if (rows != null) { EventQueue.invokeLater(new Runnable() { @Override/*from ww w . j a v a2 s . c om*/ public void run() { try { list.setSelectedIndices(rows); } catch (Exception ex) { } } }); } } }