posted 21 years ago
Hey Everyone. i have a set of JToggleButtons in a ButtonGroup and I want to change the behaviour of the ButtonGroup to unselect all buttons in the group when an already selected toggle button is clicked again. I know that this is not behaviour that ButtonGroup supports, however in the javadoc for ButtonGroup, it suggest to add an invisible button to the group and programmatically select that button when you want to unselect all button. That is not a problem. My problem is that I cannot figure out a way to detect if a button is already selected. If I use an action event, then no matter what the previous state was, isSelected() returns true. I am lost and tired. Any ideas? thanks.