Jump to content
  • Advertisement
Sign in to follow this  

Graphics help...

This topic is 4216 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
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!