I've been seeing a intermittently-reproducible problem with some of my buttons recently.
I have a button that I created by passing in a simple action, e.g.
...
JButton runButton = new JButton(new RunAction());
...
public class RunAction extends AbstractAction
{
System.err.println("action!");
// do something
}
The button is part of a simulation that is doing a lot of work and spending lots of time painting, so is probably putting a lot of weight on the event-dispatching(?) thread.
The problem is that when the simulation is running, I fairly frequently find that I can push the button,
see the button change in the UI, and yet the RunAction is not called (which I can tell because it should print something to standard error).
My questions are:
1) Does it make sense that I might see the button get pressed (so
something knew it was clicked), but the button's action doesn't get called?
2) How can I prevent this from happening?
Note that this appears to only happen on Windows (Vista) -- I haven't seen this on my Mac.
Thanks!