How can I get selected JScrollPane element?

lunar picture lunar · Nov 19, 2011 · Viewed 9.3k times · Source

All I want to do is when user selects one element on the JScrollPane and clicks button, I want to grab this object/element of the JList it holds. How can I do that?