private class QueryResultListener implements ItemListener {
public void itemStateChanged(ItemEvent e) {
// FreedbQueryResult query = (FreedbQueryResult) e.getItem();
if (freedbQueryResults != null && freedbQueryResults.length > 0) {
int selection = results.getSelectedIndex();
FreedbQueryResult query = freedbQueryResults[0];
/*
* It may occur that nothing has been selected.
*/
if (selection >= 0 && selection < freedbQueryResults.length) {
query = freedbQueryResults[results.getSelectedIndex()];