Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: Most noob question ever.

  1. #1
    Junior Member
    Join Date
    Aug 2011
    Posts
    25
    My Mood
    Bored
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Most noob question ever.

    I can't get doubles to work with drawImage. I feel stupid. I'm not sure if you can, but I've seen the outline for drawImage with the fields (img, double x, double y, observer) on Javas websites.

    I'm using Graphics2D, and when I go to plug the doubles in, I get an error saying the doubles are applicable, as the fields must be integers.

    Could some enlighten me on this please? Thank you.


  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,140
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: Most noob question ever.

    Can you explain where the location of the 10.234 pixel is? pixels are whole numbers, ie integers.
    If your data is double, you need to round it and cast it to an int


    If you think there is a method that takes double args, look in the API doc to see what class it is in. Use the Index link at the top of the page,
    select D and Find drawImage
    Last edited by Norm; December 8th, 2011 at 08:16 AM.

Similar Threads

  1. Noob needs help!
    By kram in forum What's Wrong With My Code?
    Replies: 1
    Last Post: November 2nd, 2011, 05:03 AM
  2. Total NOOB question
    By coolidge in forum Java Theory & Questions
    Replies: 3
    Last Post: September 2nd, 2011, 04:09 PM
  3. Noob question: Why .class?
    By Shaybay92 in forum Java Theory & Questions
    Replies: 10
    Last Post: August 22nd, 2011, 04:56 AM
  4. "The import ___ cannot be resolved" (stupid noob question)
    By RobG in forum What's Wrong With My Code?
    Replies: 2
    Last Post: December 18th, 2010, 03:09 PM
  5. noob question on abstract classes
    By joshred in forum Object Oriented Programming
    Replies: 1
    Last Post: September 15th, 2010, 06:27 PM