That worked! Thank you so much!
I meant f not j
Type: Posts; User: Brt93yoda
That worked! Thank you so much!
I meant f not j
I typed j.add(JPanel(this)) and I got an error. I'm sorry, but I'm very bad with images. I've looked at many different tutorials, but I just can't get it to work by myself.
no it does'nt
I did, I changed the setVisible to after the image is loaded.
I just remembered... For some reason my paintComponent method is NEVER called. ("hey" never prints in the terminal) I even put a while loop to keep the program running.
while(true)...
1. No exceptions.
2. the picture is 4tiles consiting of grass dirt water stone.
3. the image is 96x64 the JFrame is 640x480
side note. Where do I put it then?
I changed my gui class to the code below, but the drawing still doesn't show up.
import java.awt.*;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
...
How do I check the value of img, and use ImageIO?
I'm trying to make a simple game, but I'm having trouble with my Image not appearing.
(Im going to make a game loop, but this is just a test)
gameMain.class
public class gameMain {...