Question

how can i make a swing JList to have its items selected with any mousebutton not just the left one?

thanks!

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top