I'm new to using GUI in java; I'm trying to change the Image Icon for my Project but I don't know why it's not working. I'm using IntelliJ for this, I moved the image(CurrencyExchange.png) for the Icon to the "src" Folder in my Project.
import javax.swing.*;
import java.awt.*;
public class main {
public static void main(String[] args){
JFrame Frame1 = new JFrame();
Frame1.getContentPane().setBackground(new Color(0x123456));
Frame1.setTitle("Currency Changer");
Frame1.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
Frame1.setSize(500,500);
Frame1.setResizable(false);
Frame1.setLocation(430,100);
Frame1.setVisible(true);
ImageIcon image = new ImageIcon("CurrencyExchange.png");
Frame1.setIconImage(image.getImage());
}
}