Reputation: 3125
I have a Java Swing application with a JFrame
containing a JLabel
containing an ImageIcon
.
I want to monitor the mouse entering/exiting the ImageIcon
.
For now I use the addMouseListener
method of JLabel
but the event Entered & Exited are thrown only when I enter/exit the application's window, not the ImageIcon
.
I see no addMouseListener
method for ImageIcon
.
How can I do this?
Upvotes: 1
Views: 635
Reputation: 109815
I have a Java Swing application with a JFrame containing a JLabel containing an ImageIcon. I want to monitor the mouse entering/exiting the ImageIcon.
agreed, in Icon / ImageIcon isn't implemented any mouse or key event
best of options is to use un_decorated JButton
Upvotes: 1