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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T05:51:54+00:00 2026-05-31T05:51:54+00:00

Basically, I want to draw a circle using Graphics, but instead of using integers

  • 0

Basically, I want to draw a circle using Graphics, but instead of using integers to position it, I would like to use double values instead.

Ideally:

g.drawOval(0.5, 0.5, 50, 50);

Any help is greatly appreciated! Thanks in advance!

Thanks for all the help guys, but ive figured a way out, my dy variable was set at 1, so if i wanted dx to half of that of dy, it would be impossible, instead i just changed dy to 2 and dx to 1! Foolish me!

  • 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-31T05:51:56+00:00Added an answer on May 31, 2026 at 5:51 am

    The only valid way of doing this is to use an Ellipse2D.Double shape and pass it to the draw(Shape) method of a Graphics2D instance. For the best results, enable anti-aliasing:

    public void yourDrawingMethod(Graphics gg)
    {
        /* Cast it to Graphics2D */
        Graphics2D g = (Graphics2D) gg;
    
        /* Enable anti-aliasing and pure stroke */
        g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
        g.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL, RenderingHints.VALUE_STROKE_PURE);
    
        /* Construct a shape and draw it */
        Ellipse2D.Double shape = new Ellipse2D.Double(0.5, 0.5, 50, 50);
        g.draw(shape);
    }
    

    You can use Graphics2D.fill(Shape) as well.

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

Sidebar

Related Questions

I basically want to use link_to to link to the index method of a
I basically want to make things easier by just looping LinkButtons instead of making
I am trying to draw a circle with a glass effect using Alpha. I
Basically I want is to aggregate some values in a table according to a
I am basically trying to do something like classic Paint (Microsoft's program). But i
I'm making a simple prototype in HTML5 canvas, and want to basically draw a
Is there a framework I can use to draw lines with touch. Basically I
Basically I would like to turn off antialias in the following: public BufferedImage createText(String
So basically I'm using MyLocationOverlay to draw the users location on the map. However,
I basically want to do this: grep 'example.com' www_log > example.com.YYYY-MM-DD-H:i:S.log ...with of course

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.