D
drcode
Hi, I'm writing a program where multiple operations may run that affect
the gui:
if(foo){
dostuff();
SwingUtilites.invokeLater(UpdateGui());
}
if(bar){
dostuff();
SwingUtilites.invokeLater(UpdateGui());
}
if(baz){
dostuff();
SwingUtilites.invokeLater(UpdateGui());
}
This might cause multiple GUI update operations to be placed on the
queue- However, I only need my GUI to be update once- Basically, if an
update is already on the queue, I want it to not bother placing another
one on there.
Clearly, there are ways to handle this programatically (have the GUI
event check if any modifications have happened since the last update)-
But I was wondering if there was a more "Javaish" way to post an event
to be executed, but not if it's already on the event queue?
Thanks for any tips!
Conrad Barski, M.D.
the gui:
if(foo){
dostuff();
SwingUtilites.invokeLater(UpdateGui());
}
if(bar){
dostuff();
SwingUtilites.invokeLater(UpdateGui());
}
if(baz){
dostuff();
SwingUtilites.invokeLater(UpdateGui());
}
This might cause multiple GUI update operations to be placed on the
queue- However, I only need my GUI to be update once- Basically, if an
update is already on the queue, I want it to not bother placing another
one on there.
Clearly, there are ways to handle this programatically (have the GUI
event check if any modifications have happened since the last update)-
But I was wondering if there was a more "Javaish" way to post an event
to be executed, but not if it's already on the event queue?
Thanks for any tips!
Conrad Barski, M.D.