Search code examples
javaswingiconsjframeimageicon

Displaying image in a JFrame


I have a JFrame and I want to load a image to it when I click the load image button. Once I click next button I want to change the image. Loading image to a variable is no problem. I load it to Image img. I just want to show it. Which means i want to load it to a JLable or JPanel. How can I do this. Please help me.


Solution

  • Let use ImageIcon & JLabel.setIcon(...)