Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7166551
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T14:25:56+00:00 2026-05-28T14:25:56+00:00

I am trying to create three concentric circles of different color using GraphicsProgram. However

  • 0

I am trying to create three concentric circles of different color using GraphicsProgram. However the circles never appear to be concentric..they appear to be pushed off on the sides of each other as if trying to show another dimension. I am simply creating and adding the GOval objects. May be I am missing something. Is there a way to set transparency of the circles?

Adding code below:

import acm.graphics.*;
import acm.program.*;
import java.awt.*;

public class Target extends GraphicsProgram {   

    final static double radiusOuterCircle = 72.0;
    final static double radiusMiddleCircle = 47.0;
    final static double radiusInnerCircle = 22.0;


    public void run() {


        final double centerX = this.getWidth() / 2.0;
        final double centerY = this.getHeight() / 2.0;


        GOval g = makeCircle(centerX, centerY,radiusOuterCircle , Color.RED);
        add(g);


        g = makeCircle(centerX, centerY,radiusMiddleCircle , Color.WHITE);
        add(g);


        g = makeCircle(centerX, centerY,radiusInnerCircle , Color.RED);
        add(g);


    }



    private GOval makeCircle(double centerX, double centerY, double radius, Color color)
    {

        GOval g = new GOval(centerX, centerY, radius, radius);
        g.setFillColor(color);
        g.setFilled(true);

        return g;

    }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T14:25:57+00:00Added an answer on May 28, 2026 at 2:25 pm

    According to the manual the first two parameters to the four parameter GOval constructor are the coordinates for the upper left corner of the bounding box.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I spent the last three days trying to create a small app using SDL
I am trying to create a menu using anchor tags, and they should butt
for last three days i am trying to create unit test case using OcUnit.
I am trying to create an interactive background animation using WebGL / Three.js The
I'm trying to create a small html fragment (a div element) consisted of three
I'm trying to expect an error in an rspec test. lambda {Participant.create!({:user_id => three.id,
I'm trying to create a filtered FAQ page in Django. It filters by three
The first three columns exist. I am trying to create a formula for the
I am trying to create a three column page. My intention is to have
I am trying to solve a consumer/producer problem, and I have to create three

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.