Reputation: 34026
how can i make a swing JList to have its items selected with any mousebutton not just the left one?
thanks!
Upvotes: 1
Views: 1096
Reputation: 34026
oh just found the function
int s = list.locationToIndex(e.getPoint());
list.setSelectedIndex(s);
when you do this in a mouselistener it does the job.
Upvotes: 1