I'm trying to add an image to the top of my GUI as a logo.
I tried to put it in a JPanel then add the JPanel at the top of the GUI, the only problem is that my image isnt going into my JPanel.
Heres my code for it
image = new ImageIcon("reboot_logo.jpeg"); JPanel imagePanel = new JPanel(); imagePanel.setLayout(new BorderLayout()); JLabel icon = new JLabel(); icon.setIcon(image); imagePanel.add(icon, BorderLayout.NORTH); Container cp = getContentPane(); cp.setLayout(new GridLayout(3, 1)); cp.add(imagePanel);
Any ideas why this wont work?
Edited 4 Years Ago by GlenRogers