public class SelectionSynchronizer extends java.lang.Object implements javax.swing.event.ListSelectionListener
JTables always
have the same entries selected.
The tables are usually displayed side-by-side.| Modifier and Type | Field and Description |
|---|---|
private java.util.Set<javax.swing.ListSelectionModel> |
participants |
private boolean |
preventRecursion |
| Constructor and Description |
|---|
SelectionSynchronizer()
Constructs a new
SelectionSynchronizer. |
| Modifier and Type | Method and Description |
|---|---|
void |
participateInSynchronizedSelection(javax.swing.ListSelectionModel model)
Add
ListSelectionModel of the table to participate in selection
synchronization. |
void |
valueChanged(javax.swing.event.ListSelectionEvent e) |
private final java.util.Set<javax.swing.ListSelectionModel> participants
private boolean preventRecursion
public SelectionSynchronizer()
SelectionSynchronizer.public void participateInSynchronizedSelection(javax.swing.ListSelectionModel model)
ListSelectionModel of the table to participate in selection
synchronization.
Call this method for all tables that should have their selection synchronized.model - the selection model of the tablepublic void valueChanged(javax.swing.event.ListSelectionEvent e)
valueChanged in interface javax.swing.event.ListSelectionListener