The repaint Method
Note, however, that update(…) takes a Graphics argument, which is inconvenient
Instead, call the repaint() method: public void repaint();which in turn calls update(…)
Note: The repaint() method is almost never overridden by the programmer