Make sure that getSelectedValue() is not null. If list is a JList
object and the selection is empty, null will be returned.
Try something like this
MouseListener mouseListener = new MouseAdapter() {
public void mouseClicked(MouseEvent e) {
if (e.getClickCount() == 2) {
int index = list.locationToIndex(e.getPoint());
list.setSelectedIndex(index);
skinname = list.getSelectedValue().toString() ;
}}};
list.addMouseListener(mouseListener);
For more details on JList
java.sun.com/.../JList.html