I have one button which set time on Timer. So now I push. Button change time on Timer and this is still selected. In this frame I have keyListener so when I push space Timer with start but now when I push space it push again this button because it is still selected. How I can improve this button when I push it, it will not be selected ?
Share
I’m not sure of having fully understood your question.
If you want to disable click on a JButton:
If you want to unselect it:
You could also find useful prevent a button to gain focus: