Basically, i'm using 2 images for a board game type of thing, and i change it from time to time,
So i need to be able to check if two has the same imageIcon.
For example if both uses "pirosfigura.png" from the resources folder.

```
    public String malomcheck() {
    String pirosicon=lblNewLabel.getIcon().toString();
    String pirosfilenev = pirosicon.substring(pirosicon.lastIndexOf("/"  ) + 1);
    String iconfilenev = labelhely_1.getIcon().toString();
    String filenev = iconfilenev.substring(iconfilenev.lastIndexOf("/"  ) + 1);

    if(filenev==pirosfilenev) {
        lblJtkos.setText("piros malom.");
        JOptionPane.showMessageDialog(null, "working");
        return "lefutott";

    }

        return "notworking. very sad.";
    }

```

By the way the return value of the getIcon().toString() is javax.swing.ImageIcon@cd7e8021
which is refers to the memory place i guess(?) so it's random with every run and for every image therefore it's seems unusable.