Deleted unnecessary paincomponent function and repaint call.