I am working on a GUI, and I have a routine to update the display when things change underneath:
void update() {
if (needsUpdating) {
// ...
needsUpdating = false;
}
}
I'm trying to avoid calling update() "too often" -- ie, if many properties are set in succession I'd rather update() be called just once.
Is it possible to have update() called after every user input event -- key/mouse/etc? I could do this manually, but I have so many event handlers and I know I'll forget -- can Java do this for me?