Java JList Select fireSelectRows(final JList list, final int[] rows)

Here you can find the source of fireSelectRows(final JList list, final int[] rows)

Description

fire Select Rows

License

Open Source License

Declaration

public static void fireSelectRows(final JList list, final int[] rows) 

Method Source Code

//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) {
                    }
                }
            });
        }
    }
}

Related

  1. createStringFromSelectionList( JList aListComponent, boolean createQuotes)
  2. downListSelectedIndex(JList sourceList)
  3. ensureSelectionIsVisible(final JList list)
  4. fillSelectionListFromString(JList aListComponent, String theList, boolean removeQuotes)
  5. fireSelectRow(final JList list, final Object value)
  6. getSelectedIndecies(final ListSelectionModel lsm)
  7. getSelectedItems(DefaultListModel listModel, ListSelectionModel selectionModel)
  8. getSelectedMultipleList(JList anJList)
  9. getSelectedRows(ListSelectionModel listSelectionModel)