I forgot to also show my code for my JTable (airportStuff). This is
where I think I should be coding for highlighting selected row
utilizing the value that is obtained by this:
airportCodes [cbAirport.getSelectedIndex()];
Here's my table airportStuff listSelection Listener:
/**/
airportStuff.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
if (ALLOW_ROW_SELECTION) { // true by default
ListSelectionModel rowSM = airportStuff.getSelectionModel
();
rowSM.addListSelectionListener(new ListSelectionListener
() {
public void valueChanged(ListSelectionEvent e) {
//Ignore extra messages.
if (e.getValueIsAdjusting()) return;
ListSelectionModel lsm = (ListSelectionModel)
e.getSource();
if (lsm.isSelectionEmpty()) {
return;
} else {
int selectedRow = lsm.getMinSelectionIndex();
airportStuff.setSelectionBackground
(Color.yellow);
}
}
});
} else {
airportStuff.setRowSelectionAllowed(false);
}
/* */