I have a JToggleButton
, not in a group, and if it's pressed, I want to be able to Un-Select
it if I press another JButton
.
I've tried using:
toggleButton.setSelected(false);
toggleButton.doClick();
but neither un-Select the toggle button, it stays "highlighted".
What can I do so that the toggle button goes back to the normal un-Selected state, like if I pressed it again?
Is it a matter of calling the above while in the UI Thread?