Consider the use of javax.swing.Action-controlled Swing components.
This way you can disable the action directly with Action.setEnabled. Its component will automatically accept its state. When disabled in this way, the components will not receive MouseEvents.
See documents in the designer JButton(Action).
source
share