Hello!
Full disclosure: this problem is part of an exercise - so I'm only looking for tips & suggestions - yet I'm completely stuck, so I feel the need to ask for help.
I'm trying to create a window that displays images. You can turn over the images by clicking on them, and move them by holding them.
I wanted to use JFrame, JPanel, JLabels, and ImageIcons to solve the task, yet I'm now allowed to use JLabels - so I've attempted to use a paintComponent instead.
I currently got a JFrame, with a JPanel, and an image drawn on the JPanel. I've also been able add a MouseAdapter to the JPanel that gets the coordinates of the area being pressed. Yet I don't know how to use it to select my ImageIcon - maybe save the JPanel area the ImageIcon occupies, so I can check the mouse coordinates against it? - or something else?
Your help is highly appreciated!
/Cheers
CODE LINK:
https://www.dropbox.com/sh/9m5n64vqmmw5o8w/AACl_h1eO6seW42TULZ-jZGha?dl=0
CODE:
IMAGE EXAMPLE: