I am designing a program that contains two JPanels within a JFrame, one is for holding an image, the other for holding GUI components(Searchfields etc). I am wondering how d
I'd like to suggest a more simple way,
image = ImageIO.read(new File(path));
JLabel picLabel = new JLabel(new ImageIcon(image));
Yayy! Now your image is a swing component ! add it to a frame or panel or anything like you usually do! Probably need a repainting too , like
jpanel.add(picLabel);
jpanel.repaint();