I have a program that detects when certain machines are online and creates a button with a green \"online\" icon to show this. I want to add the functionality to check perio
I have a program that detects when certain machines are online and creates a button with a green "online" icon to show this.
Use a JToggleButton instead, as shown here1 & here2.
I can't figure out a way to do it once the button has already been displayed.
To toggle the state and fire an action event doClick() or alternately setSelected(boolean).