Problems with ImageIcons
Hello everybody. I am new here and relative newbie on Java.
I have done an almanac with ImageIcons. One for each day. I used drawImage method. I used Over them I have used drawString method to print the date. Is it possible to get the ImageIcons clickable? I can´t use actionListener, but I can use a mouseListener on the panel where the imageIcons are lined up. But then I have to calculate witch imageIcon I was clicked wigh getX() and getY() method.
Is there any simplier way to do this?
You can use JButtons with icons and text, probably in a GridLayout. Then you get to use ActionListener and don't have to calculate which was clicked.
To get a 'plain' appearance for the JButtons you can
Yes, that is one solution. Mayby I can´t get the what i want with the ImageIcons. Thank´s for the reply! :)