As VonC's answer, there's no simple solution existed. So i recommend you to programe with a supporting infrastructure from the start.
A simple infrastructure is likely to be, for example, using delegated listeners that do a "event enabled" check from a super container's flag before actual event-respond:
class ControlledActionListener extends ActionListener {
...
public void actionPerformed( ActionEvent e ) {
if( !container.isEnabled() ) return;
doYourBusinessHere();
}
}
Or even better, you can use the APT to automatically inject the boilerplate code for you.
This works well all the time. It's the clean way to block both user interaction and programming calls with a single effort. Even though it costs you some codes to support the underlying functionality, you get simplicity, usablity and stability in return.
PS. i'd like to see better solution to this problem.