I know that item1.setToolTipText("This shows up on mouse hover");
will allow text to show up if the mouse hovers over it. I was wondering if I could make the image change on mouse hover? Thanks in advance.
相关问题
- Views base64 encoded blob in HTML with PHP
- Delete Messages from a Topic in Apache Kafka
- Jackson Deserialization not calling deserialize on
- How to maintain order of key-value in DataFrame sa
- How to get the background from multiple images by
I would add a
MouseListener
to your component that holds the image.Then just override the methods
mouseEntered(MouseEvent e)
andmouseExited(MouseEvent e)
to change the image.Here's a full working example :