Re: JList getSelectedValue returning null



This is really poor code, and running it through a code checking
utility such as CheckStyle would probably give the answer:

Object o=null;
try {
o=data.elementAt(index);
} catch (Exception ex) {
//System.out.println("Index out of bounds" +
ex.toString());
}
return o;

That looks like a good candidate for returning null. You are
swallowing all possible exceptions. DON'T.

http://findbugs.sourceforge.net/bugDescriptions.html#REC_CATCH_EXCEPTION
and
http://checkstyle.sourceforge.net/config_coding.html#IllegalCatch

.