Já olhei muitos tutoriais mas não consigo colocar a imagem, meu maior progresso foi o seguinte código que achei aqui no guj:
No entanto, ele cria um novo frame…preciso que abra no menu.
public class JImagePanelSingleTest1 {
public static void main(String[] args) throws Throwable {
Toolkit tk = Toolkit.getDefaultToolkit();
Dimension d = tk.getScreenSize();
JImagePanel panel = new JImagePanel(
loadImage("/img1.jpg"));
JFrame frame = new JFrame();
frame.setPreferredSize(new Dimension(d.width, d.height));
frame.add(panel);
frame.pack();
frame.setLocationRelativeTo(null);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setVisible(true);
}
private static BufferedImage loadImage(String file) throws IOException {
return ImageIO.read(new File(file));
}
}