public void run() { while (true) { while (! m_paintQueue.isEmpty()) { repaint(); } synchronized(m_paintQueue) { m_paintQueue.wait(); } } }