draw by request instead of drawing with specified fps
how can I update image by my own (when model changes) or system (when other window corrupted image) repaint request and not to use FPSAnim开发者_高级运维ator?
One approach is to use the Model-View-Controller pattern, with the controller having a timer that notifies the view(s) only when required. I generally prefer javax.swing.Timer
, as the action event handler executes on the event-dispatching thread.
精彩评论