List of usage examples for javax.swing DefaultListSelectionModel getAnchorSelectionIndex
@Transient public int getAnchorSelectionIndex()
From source file:Main.java
public Main() { setLayout(new BorderLayout()); list = new JList(label); JScrollPane pane = new JScrollPane(list); DefaultListSelectionModel m = new DefaultListSelectionModel(); list.setSelectionModel(m);// w w w . j av a 2 s.c om System.out.println(m.getAnchorSelectionIndex()); add(pane, BorderLayout.NORTH); }