Mouse over JButton
I have an 10 x 10 array of JButtons in my project. I was just wondering how do i find out which button the mouse cursor is over at any given time?
I have tried adding the following to the buttons:
You can try to use the mouseEntered method in MouseListener and you can try to get the X and Y coordinates from the mouse and check which button it is on. Which would be getX and getY from the MouseEvent.