good evening. I'm trying to create a transparent button with the setOpaque () method and I can not. Anyway I'm wrong method, who knows how to do it?
good evening. I'm trying to create a transparent button with the setOpaque () method and I can not. Anyway I'm wrong method, who knows how to do it?
you can make the button transparent by modifying its color, and changing the Opaque property to false, it would be like this:
JButton jButton1=new JButton();
jButton1.setOpaque(false);
jButton1.setBackground(new Color(0,0,0,0));
I hope I have helped you.
actually I saw what happened xDD I did the buttons in another JPanel on top of another JPanel and that's why when I put those commands was transparent yes, but what you saw was the background jpanel default and not the sheet that there was below