• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JButton with a round image

 
Alexandre Baldo
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!!
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
 
Maneesh Godbole
Saloon Keeper
Posts: 11164
14
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
On XP LAF setBorderPainted(false) might not be sufficient. You might have to use addButton.setBorder(null)
 
Campbell Ritchie
Sheriff
Pie
Posts: 50168
79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank`s guys!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic