下面列出了javax.swing.ListSelectionModel#getValueIsAdjusting ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。
public void valueChanged(ListSelectionEvent e) {
ListSelectionModel selModel = existingPrincipalsTable.getSelectionModel();
if(!selModel.getValueIsAdjusting()) {
int selectedRow = existingPrincipalsTable.getSelectedRow();
if(selectedRow != -1) {
Object entry = existingPrincipalsModel.getRow(selectedRow);
if(entry instanceof PrincipalNameMapping) {
PrincipalNameMapping principalEntry = (PrincipalNameMapping) entry;
principalName = principalEntry.getPrincipalName();
className = principalEntry.getClassName();
updateTextFields();
firePropertyChange(Constants.USER_DATA_CHANGED, null, null);
}
}
}
}
public void valueChanged(ListSelectionEvent e) {
ListSelectionModel selModel = existingGroupsTable.getSelectionModel();
if(!selModel.getValueIsAdjusting()) {
int selectedRow = existingGroupsTable.getSelectedRow();
if(selectedRow != -1) {
Object entry = existingGroupsModel.getRow(selectedRow);
if(entry instanceof String) {
groupName = (String) entry;
updateTextFields();
firePropertyChange(Constants.USER_DATA_CHANGED, null, null);
}
}
}
}