void (ListSelectionEvent e) { JList sourceList = (JList) e.getSource(); final Object selValue = sourceList.getSelectedValue(); if (selValue != null) { myTextField.setText(selValue.toString()); } else { myTextField.setText(""); } updateValue(); }