Nick LiMuti

Greenhorn
+ Follow
since Nov 02, 2011
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Nick LiMuti

Rob Spoor wrote:

Nick LiMuti wrote:I am having an issue that seems to be a bit similar to this, although I haven't read the above posts overly thoroughly.


Then I suggest you start by reading the above posts. The solution has definitely been discussed. In short, you should not use getGraphics().



I said it was similar to this, not exactly the same. I do not want to draw a shape to the screen, I want to add an image to the JFrame. However, I have found another way to do this, although it would be great if someone could please tell me a different way, as this doesn't seem like the correct way to do it. Unless it is, in which case never mind. Also, if using an image is the same as using a Graphics object then I will definitely look further into it. My teacher said that it isn't though (although she may be incorrect).

Here's my new code:

12 years ago
I am having an issue that seems to be a bit similar to this, although I haven't read the above posts overly thoroughly. I can't get an image to display in a JFrame. If someone could take a look at my code and tell me what my mistakes are, that would be fantastic and i would be extremely grateful.


NOTE: This code does not give me any errors, it just fails to display the image in the JFrame. Also, I have used "10" as my int for most of it, so if this is an issue could someone please tell me how to fix it? As far as I have been able to decipher from the API, the ints here mainly control size and positioning.


12 years ago