I have a JTable that looks like it is refreshing every tim that i clink on it.
rowSM.addListSelectionListener(new javax.swing.event.ListSelectionListener() {
public void valueChanged(javax.swing.event.ListSelectionEvent e) {
//Ignore extra messages.
if (e.getValueIsAdjusting()){
return;
}
ListSelectionModel lsm = (ListSelectionModel)e.getSource();
if (lsm.isSelectionEmpty()) {
//no rows are selected
} else {
//selectedRow is selected
int selectedRow = lsm.getMinSelectionIndex();
if (GridDisplay.bCabOrUser){
GridDisplay.UserName = (
String)tabMain.getValueAt(selectedRow, 0);
GridDisplay.sLoggedOut = (String)tabMain.getValueAt(selectedRow, 2);
}
else if ( ! GridDisplay.bCabOrUser){
GridDisplay.IndexName = (String)tabMain.getValueAt(selectedRow, 0);
GridDisplay.IndexType = (String)tabMain.getValueAt(selectedRow, 1);
Dependancy(GridDisplay.IndexType);
}
}
}
});
that is what i am doing with the listselection listener.
does anyone have an idea as to what i must do?