1

Thank you for your kind, we learned from you many times. I have xJButton class inherits JButton class.

I am doing this to add an image as icon and change it after it clicked.

I do not want the blue color to be as background and also i don't want any border on it.

Everything is working vine, except the border.

You can see there is 2 borders

enter image description here

setOpaque(false);
setContentAreaFilled(false);
setBackground(null);

can you help me?

Eduardo Briguenti Vieira
  • 4,351
  • 3
  • 37
  • 49
  • 1
    possible duplicate of [Transparent JButton](http://stackoverflow.com/questions/4585867/transparent-jbutton) – Dan Grahn Apr 20 '15 at 17:14

1 Answers1

1

You should be able to do it like this:

xJButton.setBorder(null);
xJButton.setBorderPainted(false);
xJButton.setContentAreaFilled(false);
xJButton.setOpaque(false); 
NRKirby
  • 1,584
  • 4
  • 21
  • 38
  • You're welcome, I am glad I could help you . Btw an upvote would be gratefully received for a struggling junior such as myself :) – NRKirby Apr 20 '15 at 17:49