Results 1 to 3 of 3
  1. #1
    TheSheepeh is offline Member
    Join Date
    Mar 2011
    Posts
    5
    Rep Power
    0

    Default Load and Draw image

    Hi

    Trying to load an image and draw it on the screen. The image is not drawing however.

    import java.awt.Color; import java.awt.Graphics; import java.awt.Image; imp - Pastebin.com

    The commented lines that draw a rectangle works fine, so its not an issue with anything outside this class.

    Thanks

  2. #2
    TheSheepeh is offline Member
    Join Date
    Mar 2011
    Posts
    5
    Rep Power
    0

    Default

    bump

    Any idea anyone?

  3. #3
    TheSheepeh is offline Member
    Join Date
    Mar 2011
    Posts
    5
    Rep Power
    0

    Default

    scratch that, I fixed it should have been this

    Image img = Toolkit.getDefaultToolkit().getImage(getClass().ge tResource("player.png"));

Similar Threads

  1. Why doesn't the image draw?
    By MrFish in forum Java 2D
    Replies: 20
    Last Post: 11-16-2010, 08:32 PM
  2. load image in the jsp page
    By maneuk in forum Eclipse
    Replies: 0
    Last Post: 04-09-2010, 10:23 PM
  3. ImageIcon won't load my image
    By JaiRaj in forum AWT / Swing
    Replies: 5
    Last Post: 03-04-2010, 07:35 PM
  4. Can not load image in SWT/Eclipse
    By janice in forum SWT / JFace
    Replies: 4
    Last Post: 10-03-2008, 05:53 PM
  5. Help with load image
    By trill in forum New To Java
    Replies: 1
    Last Post: 08-01-2007, 08:16 AM

Posting Permissions

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