| Author |
JButton with a round image
|
Alexandre Baldo
Ranch Hand
Joined: Aug 04, 2006
Posts: 48
|
|
Hello guys! I'll try to explain the problem... I have a JButton: The ImageIcon is a GIF. A round GIF. The problema is that when the button is displayed the addButton's border appears as well (there's a rect surrounding it)... I want just the Image to be shown! Does anyone knows how can I do that? Thank's!!
|
...ops!<br>-----------------<br>
SCJD<br>
SCWCD 1.4<br>
SCJP 1.4
|
 |
Gregg Bolinger
Ranch Hand
Joined: Jul 11, 2001
Posts: 15229
|
|
Try addButton.setBorderPainted(false) http://java.sun.com/j2se/1.5.0/docs/api/javax/swing/AbstractButton.html#setBorderPainted(boolean)
|
 |
Maneesh Godbole
Saloon Keeper
Joined: Jul 26, 2007
Posts: 8430
|
|
|
On XP LAF setBorderPainted(false) might not be sufficient. You might have to use addButton.setBorder(null)
|
[Donate a pint, save a life!] [How to ask questions] [Onff-turn it on!]
|
 |
Campbell Ritchie
Sheriff
Joined: Oct 13, 2005
Posts: 32599
|
|
|
Worth doing a search of this forum; questions about round buttons come up about twice a year. If you find anything useful, be sure to post a link to it with the URL button below.
|
 |
Alexandre Baldo
Ranch Hand
Joined: Aug 04, 2006
Posts: 48
|
|
|
Thank`s guys!
|
 |
 |
|
|
subject: JButton with a round image
|
|
|