Sign in to follow this  
XG08Zero

Graphics help...

Recommended Posts

XG08Zero    138
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this