I have a JPanel to which I\'d like to add JPEG and PNG images that I generate on the fly.
All the examples I\'ve seen so far in the Swing Tutorials, specially in the
Create a source folder in your project directory, in this case I called it Images.
JFrame snakeFrame = new JFrame(); snakeFrame.setBounds(100, 200, 800, 800); snakeFrame.setVisible(true); snakeFrame.add(new JLabel(new ImageIcon("Images/Snake.png"))); snakeFrame.pack();