how to make JLable visible and Translucent (almost invisible) on mouse hovering

234 Views Asked by At

I made a Wrappable JLabel which shows text message within the label with multiple lines. The label and text (i.e. foreground and background) are visible all time.

Now I want to change the JLabel such that it should be visible only after mouse hover and rest of the time it should be translucent. How can I achieve this? please help me .. thanks in advance .

1

There are 1 best solutions below

3
On

For mouse hover over the JLabel you have to call repaint() in all methods from MouseXxxListener, reason is the this notifier isn't implemented in the JLabel API, more inc. descriptions in the post by @kleopatra