so many things just plain wrong
1) *always* start a swing GUI in the Swing
thread (EDT), via SwingUtilities.invokeLater(...)
2) *never* *ever*, have Thread.sleep() in the same thread where repainting or event listening occurs,
separate thread or (usually) better to use a Swing Timer.
3) not sure if you're using 'extends Canvas', but don't use it in Swing, use a JPanel and its paintComponent()
that should do for starters, but to answer your initial question/problem, in Swing, any time you add/remove
components from a visible container, this is the sequence: