• Advertisement
Sign in to follow this  

Graphics help...

This topic is 4090 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I decided to use Java Graphics2D for my game's graphics for now. I got a book- "Beginning Java 5 Game Programming" by Johnathan S. Harbour. He uses this graphics class, but his examples are in applet form. I really don't want to make my game an applet for now, so I'm having trouble using his example code in my game (which is an application) The book uses... image = getImage(getURL("castle.png")); My only problem is do I HAVE to use a URL? How can I with an application. I tried using ImageIcon, which I can just specify the path of the image file, but I can't use ImageIcon in most of the Graphics2D class. This doesn't work- as there is no contructor that accepts the file path image = getImage("Img Src/minton_temp.bmp"); How can I simply load the image so I can display it? I'm really stumped...

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement