void TurtlePanel::PaintComponent(Graphics* g) { g->DrawText(Point(20, 20), "Turtle Graphic Output: "); AffineTransform trans = g->GetTransform(); trans = trans * trans.MakeTranslation(20, 50); g->SetTransform(trans);//set transform //repaint g->SetForegroundColor(XApplication::GetInstance()->GetBlackColor()); g->FillRect(this->GetBounds()); g->SetForegroundColor(XApplication::GetInstance()->GetWhiteColor()); g->SetForegroundColor(XApplication::GetInstance()->GetWhiteColor()); g->DrawRect(this->GetBounds()); }