This week's book giveaway is in the Design forum.
We're giving away four copies of Design for the Mind and have Victor S. Yocco on-line!
See this thread for details.
Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Color

 
Jude Fawly
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there,

I have a panel that includes a label. I've added a mouse listener on the label. This is how it is working now: when I click on the label, I reset the background color of the panel:

panel.setBackground(Color.PINK);

and then set it to another color:

panel.setBackground(new Color(30,100,10,40));

The problem is with the alpha component I am using with the color; now whenever I click on the label, the color of the panel is becoming darker and darker (the transparency of the color is reducing). Notice that the code panel.setBackground(Color.PINK) is working and i am sure of it.
I hope I made my point clear.

Waiting for any help.
Thanks.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic