Question

I have a JList, and a JButton, user can click an item in the JList or they can click the button, when the button is clicked how do I de-select (change the selected list item bgcolor to normal, in other words, nothing in the JList will be selected after the button is clicked) the item from the JList ?

Was it helpful?

Solution

The JList should have a clearSelection() method that you can call.

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