added thread.sleep between a repaint jpanel and component