Graphics help...
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...
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement