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

    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 Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,202
    Rep Power
    19

    Default

    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)

    db

Similar Threads

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