Skip to Main Content

Java Programming

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!

Quick question - JButton containing an Image - removing the Images border?

807588Feb 25 2009 — edited Feb 26 2009
Hi, I have a JButton with an image inside it.
I would like the JButton to have a border, but not the image when it is clicked.
It currently looks like this - here
As you can see, there are two borders (this is once the button has been clicked).
The one around the JButton is the one I wish to keep, the one around the ImageIcon is the one I would like removed.
I am sure there is a simple way to do this - I'm sure I have managed it before.

part of the code used to create:
JButton money = new JButton();
money.setBackground(buttonColor);
money.setIcon(new ImageIcon ("money.gif");
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 26 2009
Added on Feb 25 2009
2 comments
456 views