I have a JLabel that changes its background color when the mouse enters it. The problem I have is that I want the JLabel to become transparent after the mouse exits.
Is there a statement I can use to accomplish this?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It’s a lazy holiday here in Germany, so combining the two answers:
The problem (actually, I tend to regard it as a bug) is that setting the opaque property doesn’t trigger a repaint as would be appropriate. JComponent fires a change event, but seems like nobody is listening: