List of usage examples for javax.swing DefaultListSelectionModel isSelectionEmpty
public boolean isSelectionEmpty()
From source file:Main.java
public Main() { setLayout(new BorderLayout()); list = new JList(label); JScrollPane pane = new JScrollPane(list); DefaultListSelectionModel m = new DefaultListSelectionModel(); m.addListSelectionListener(new ListSelectionListener() { public void valueChanged(ListSelectionEvent e) { System.out.println(e.toString()); }// ww w . j a v a 2 s .c o m }); list.setSelectionModel(m); System.out.println(m.isSelectionEmpty()); add(pane, BorderLayout.NORTH); }