I am trying to add n image to a panel using Netbeans. I dragged a Panel from the palette on to the frame and sized it according to what I want the image size to be. In the constructor I then added the image to the panel(I named it panelImage) like this.
JLabel label = new JLabel(new ImageIcon("images\\BrokenFrameResized.jpg"));
paneImage.add(label);
The image however does not display. What is the best way to have the an image displayed as the size of the Panel using Matisse layout manager(i.o.w. dragging and dropping the panel).
Is it better to use paintComponent(Graphics g)?.