List of usage examples for javax.swing.event ListSelectionListener interface-usage
From source file Main.java
public class Main extends JFrame implements ListSelectionListener { public Main() { setLayout(new GridLayout(1, 2)); String[] numbers = { "one", "two", "three", "four", "five", "six", "seven" }; JList<String> list = new JList<>(numbers); list.setVisibleRowCount(1);
From source file SharedListSelectionHandler.java
class SharedListSelectionHandler implements ListSelectionListener { public void valueChanged(ListSelectionEvent e) { ListSelectionModel lsm = (ListSelectionModel) e.getSource(); int firstIndex = e.getFirstIndex(); int lastIndex = e.getLastIndex();
From source file SharedListSelectionHandler.java
class SharedListSelectionHandler implements ListSelectionListener { public void valueChanged(ListSelectionEvent e) { ListSelectionModel lsm = (ListSelectionModel) e.getSource(); int firstIndex = e.getFirstIndex(); int lastIndex = e.getLastIndex();
From source file ListTest.java
public class ListTest extends JFrame implements ListSelectionListener { JLabel label = new JLabel("The fox jumps over the lazy dog."); public ListTest() { setTitle("ListTest: Press control to multi-select"); setSize(400, 300);
From source file Main.java
class MyListSelectionListener implements ListSelectionListener { public void valueChanged(ListSelectionEvent evt) { if (!evt.getValueIsAdjusting()) { JList list = (JList) evt.getSource(); Object[] selected = list.getSelectedValues();
From source file SelectionHandler.java
public class SelectionHandler implements ActionListener, ListSelectionListener { private JLabel direction; private JList source, destination; public SelectionHandler(JLabel d, JList left, JList right) {
From source file LongListTest.java
public class LongListTest extends JFrame implements ListSelectionListener { JLabel label = new JLabel(); public LongListTest() { setTitle("LongListTest"); setSize(400, 300);
From source file Main.java
class SelectionListener implements ListSelectionListener { JTable table; SelectionListener(JTable table) { this.table = table; }
From source file Main.java
public class Main implements ListSelectionListener { String[] headings = { "Name", "Customer ID", "Order #", "Status" }; Object[][] data = { { "A", new Integer(3), "0", new Date() }, { "B", new Integer(6), "4", new Date() }, { "C", new Integer(9), "9", new Date() }, { "D", new Integer(7), "1", new Date() },
From source file org.feistymeow.dragdrop.dragdrop_list_test.java
/**
* A demo of the DragonDropHandler being used with a JList. Much love to the internet for lots of
* examples.
*
* @author Chris Koeritz
* @copyright Copyright (c) 2012-$now By University of Virginia