لدي سؤال في الجافا باستخدام برنامج JCreator وهو رسم دوائر داخل بعضها أو مربعات على حسب طلب المستخدم كما في الصور التالية


لكن لم أستطع معرفة مركز لوحة الرسم وعندما عملت البرنامج أصبح بالشكل التالي


وهذا هو السؤال الرئيسي:
Draw 12 concentric circles in the center of a JPanel. The innermost circle should have a radius of 10 pixels, and each successive circle should have a radius of 10 pixels larger than the previous one. Begin by finding the center of the JPanel. To get the upper-left of the comer of a circle, move up one radius and to the left one radius from the comer. The width and height of the bounding rectangle is the diameter of the circle (twice the radius).
NOTE: (he program should ask the user which shape to draw, 1 for circle, and 2 for rectangle. Depend on user choice one of the following draws will be displayed.
الكود موجود في المرفقات