Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Why does JButton background color change when clicking ?

843805Aug 17 2006 — edited Nov 23 2006
Hello,

I have defined :
JButton mybutton = new JButton(Icon xxx) ;

with no associated text and I set both foreground and background colors to black, and an empty border.

This is because the background color of the container which contents this button is also black and I want to see only the button icon.

When I click on the icon , the button background color becomes grey. How can I change this to make it remains black ?

Thanks a lot.

Gege
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 21 2006
Added on Aug 17 2006
9 comments
3,724 views