I'm developing a java project for a university exam. The project involves the creation of an application with the JDBC methodology. The project is almost finished, I was dedicating myself to the aesthetic part and here the problems begin :( . I'm trying to put an icon to the application with the following instructions:
public MainFrame() {
        try {
            setIconImage(ImageIO.read(getClass().getResourceAsStream("/resources/icon.png")));
        } catch (IOException e) {
            System.out.println("Icon Image could not be loaded");
        }
The console gives me this:
java.lang.IllegalArgumentException: input == null!
    at java.desktop/javax.imageio.ImageIO.read(ImageIO.java:1358)
    at Boundary.MainFrame.<init>(MainFrame.java:52)
    at Boundary.MainFrame$1.run(MainFrame.java:38)
How can I fix?