How to disable Swing button so I can change it by another button?
<p>I have Java Swing GUI, where I use 2 panels. The first panel holds buttons and these buttons represent Keys in Facility. The second panel is a control panel with some buttons and inputs.</p>

<p>And I need to do following: If I click on button in the first panel, it is disabled until I do some operation in the second panel or click it again. But obviously, if I click one button and then another one, the first one is not clicked anymore. </p>

<p><em>Is there a way, how to disable the first button on click, keep it disabled and then proceed an operation to this button by clicking another button?</em></p>