Results 1 to 2 of 2
  1. #1
    Josep_16's Avatar
    Josep_16 is offline Member
    Join Date
    Mar 2011
    Rep Power

    Default Can't it be drawOval( int, double, int, int) ?

    Hi there. I was trying to insert a decimal number as an Y coordinate, when while compiling it said me that drawOval() only accepts int parameters. So, does it mean that necessarily an applet can't draw something on a decimal number pixel, and only it can draw on integer number pixels? I mean, isn't there any way to draw something at pixel 12.5 or 20.3, using double parameters instead of integer ones? Thanks.

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Madgaon, Goa, India
    Rep Power


    isn't there any way to draw something at pixel 12.5 or 20.3
    And where would that be rendered to the screen?

    Approximations using anti-aliasing are possible with the Graphics2D API. See the class Ellipse2D.Double / Ellipse2D.Float and the Graphics2D methods setRenderingHints(...) and draw / fill (Shape).

    also go through Trail: 2D Graphics (The Java™ Tutorials)


Similar Threads

  1. double a * double b = weird output
    By GPB in forum New To Java
    Replies: 3
    Last Post: 03-26-2010, 11:40 AM
  2. How to duplicat drawOval horizontally?
    By ntagrafix in forum AWT / Swing
    Replies: 1
    Last Post: 12-03-2009, 10:37 PM
  3. Check if double is double
    By marshalthrone in forum New To Java
    Replies: 8
    Last Post: 09-30-2009, 03:51 PM
  4. Replies: 5
    Last Post: 03-21-2009, 10:32 PM
  5. Double.valueOf() vs Double.parseDouble()
    By greenbean in forum New To Java
    Replies: 10
    Last Post: 01-12-2009, 09:39 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts