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 7759295
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T13:35:33+00:00 2026-06-01T13:35:33+00:00

I made another question about two weeks ago with having trouble with the Circle

  • 0

I made another question about two weeks ago with having trouble with the Circle class. I couldn’t exactly pinpoint a direct code to put on here to show you guys but no matter what I do with the Circle class, or any thing similar to it, I can’t get the code to compile.

I have tried copying directly out of my textbook to see if the code provided by my teacher and the book will work, and I still get a “Cannot find symbol” whenever I try to create a Circle or Rectangle. Here’s some code from my book for example

import javax.swing.JApplet;
import java.awt.Color;
import java.awt.Graphics;

public class Week8_ExtraCredit extends JApplet
{
    private int centerX = 200, centerY = 150;
    private Color toggleColor = Color.BLACK;
    private Circle circle;

    public void paint( Graphics g )
    {
        super.paint( g );

        for ( int diameter = 200; diameter >= 20; diameter -= 20 )
        {
            circle = new Circle( centerX - diameter / 2,
                                 centerY - diameter / 2,
                                 diameter, toggleColor );

            circle.draw( g );

            if ( toggleColor.equals( Color.BLACK ))
                toggleColor = Color.RED;
            else
                toggleColor = Color.BLACK;
        }
    }
}  

This code is pulled directly from my book which is supposed to create a circle of with black and red rings inside of it. But running it, I get this error

C:\Users\yardeen\Documents\JCreator LE\MyProjects\Week8_ExtraCredit\src\Week8_ExtraCredit.java:17: error: cannot find symbol
    private Circle circle;
            ^
  symbol:   class Circle
  location: class Week8_ExtraCredit

This is given for every instance the class Circle is called upon. If I could get any help as to why I’m getting this problem, that would be awesome! This has been the only thing stumping me in learning Java so far. :\

  • 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-06-01T13:35:34+00:00Added an answer on June 1, 2026 at 1:35 pm

    Assuming you didn’t create a Circle class as your code and the above comments suggest, here’s an alternate solution (unless you’re required to create your own Circle class):

    Make sure you have these imports:

    import java.awt.*;
    import java.awt.event.*;
    import java.awt.geom.*;
    

    And then create an Ellipse:

    Shape circle = new Ellipse2D.Double(x, y, width, height);
    

    This line will replace your “circle = new Circle” line. Make sure x, y, width, and height are doubles, and if you want further information check out this.

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

Sidebar

Related Questions

I've recently made another question about connecting to MS-ACCESS database with .NET in C#
I'm having a problem with running an application I made on another computer. This
First of all, this isn't another question about storing images on DB vs file
I responded to another question about developing for the iPhone in non-Objective-C languages, and
I have a simple question about Python: I have another Python script listening on
I added a new file F1 and made changes to another file F2 but
I merged a branch to another branch and then made some of my own
I want to make new stackpanal from another stackpanal already made before but if
Given a string made up of 3 capital letters, 1 small caps and another
For example, if a request is made to a resource and another identical request

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.