Invisible JButton does not stay invisible when pressed.

I have an invisible JButton on top of an image.  The problem is... when the button is pressed it turns to gray.
I would like the button to stay invisible when clicked.  Ideally, only the border would change.

Note that I do need an invisible button (to long to explain why) so a solution that proposes to build the JButton with
JButton( Icon icon) would not be acceptable for me.

Presently the only thing I'm doing is to set setOpaque(false);

Thank you in advance for you help and advices.
SolangeRichardAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

objectsCommented:
how is your button invisible?
0
expertmbCommented:
>>The problem is... when the button is pressed it turns to gray.
button is there on container, it is receiving events(action/click). if the button is invisble it will not recieve any events.
0
sciuriwareCommented:
yourButton.setVisible(false);
To make it visible again you can not click the invisible button,
but something else of course.
<*>
0
Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

SolangeRichardAuthor Commented:
ohhhh I'm so sorry (my primary is french not english).  
I really meant "tranparent".   Only the border appears but we can see the image under the button.
I hope this is a little more helpfull?  In fact it is just NOT opaque.  And I want the button to be not opaque still when it's pushed.  

Thank you and sorry for the confusion.
0
sciuriwareCommented:
You mean transparent.
You want the button to go transparent when it's pushed?
Why not give it an icon-when-pressed.
That icon might be a white picture, made entirely transparent by the microsoft photoeditor.
<*>
0
sciuriwareCommented:
YourButton.setPressedIcon(Icon pressedIcon);
Hope it works for you.
<*>
0
objectsCommented:
try:

button.setContentAreaFilled(false);
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
SolangeRichardAuthor Commented:
objects: It was so simple!
Thank you very much it worked.

sciuriware: Sorry,  I tried your proposed solution but it did not work.
Thank you anyway for taking time to try to help me.
0
sciuriwareCommented:
You don't have to be sorry.
<*>
0
objectsCommented:
(:
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Java

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.