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
You can avoid using own Components and SwingX library and ImageIO class:
Component
ImageIO
File f = new File("hello.jpg"); JLabel imgLabel = new JLabel(new ImageIcon(file.getName()));