Some operating systems generate keyPressed events more quickly than my application can handle them. My first thought was to not perform the action if the calls are too close together, with something like this:
public void actionPerformed(ActionEvent e) {
long now = System.currentTimeMillis();
if(now - lastCall < 150) {
System.out.println("dropping event");
}
else {
lastCall = now;
}
}
Unfortunately despite the event dropping, the application still locks up and builds up tons of events in the queue. Is there a way I can drop events at a lower level? I think by the time they get to my action listener above, it's too late to save the application from locking up. Thanks for your help!
EDIT: I should also mention that the listener is part of an AbstractAction that is associated with a menu item.