List of usage examples for javax.swing JList addSelectionInterval
public void addSelectionInterval(int anchor, int lead)
From source file:Main.java
public static void main(String[] argv) throws Exception { String[] items = { "A", "B", "C", "D" }; JList list = new JList(items); int start = 2; int end = 2;// ww w . j a v a 2 s.co m list.addSelectionInterval(start, end); }