I am trying to follow a tutorial given by Oracle found here and having some difficulties.
I copied the entire code, found here, and it worked fine with the given image.
The problem is if I give it a new larger image it only shows the top left corner that was the same size as the given image. The getHeight and getWidth methods are returning the correct values and the drawImage method is being the right values as well.
I can seem to figure out why its doing this. BTW the window appears at the correct size but only the top corner is being drawn.
Any help would be very appreciated.
Just figured it out! Im using Eclipse and under properties it was given inputs of 200 x 200.
I just need to figure out how to make this dynamic based on the image.
Since you're doing this in an applet, I believe that the size of the applet is determined in the HTML code -- though I may be wrong as I'm no applet expert!
I'm very new to this, but I'm not running this through html at all.
I don't even know if I know the difference between an applet and an application.
I'm inferring that an applet is on a web page and the other is not.
Correct. If you are running your applet in Eclipse, then you're using it's applet viewer. If you want to create a Swing stand-alone program, then create a JFrame.
Originally Posted by dvreed77