package cz.muni.fi.bronchus.gui; /* * SelectionListener.java * * Created on November 19, 2004, 6:10 PM */ import javax.swing.event.ListSelectionListener; import javax.swing.event.ListSelectionEvent; import javax.swing.JTable; /** * * @author xudrzal */ public class SelectionListener implements ListSelectionListener { private JTable table; private int amount; SelectionListener(JTable table, int k) { this.table = table; amount=k; } public void setAmount(int i) { amount=i; } public void valueChanged(ListSelectionEvent e) { // If cell selection is enabled, both row and column change events are fired if (e.getSource() == table.getSelectionModel() && table.getRowSelectionAllowed()) { // Column selection changed int[] rows=table.getSelectedRows(); for (int i=0; i