Graphics help...

Started by
-1 comments, last by XG08Zero 17 years, 5 months ago
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...
-----------------------AMD Sempron 3400+, 1.7Gb PC3200 RAM, PNY nVidia GeForce 7600GT Money Spent- $465.00runs FEAR at max settings! (1024x768)

This topic is closed to new replies.

Advertisement