Just like we can resize a JFrame
I'd like to show an image on a frame. I'd like to be it resizeable so when I resize the image should be resized.
How could I do this?
try {
myPicture = ImageIO.read(f);
picLabel.setIcon(new ImageIcon(myPicture));
panel.add(picLabel);
} catch (IOException e) {
e.printStackTrace();
}
I added the label (with the image) to a JPanel
and the panel is added to the frame.