I set the icon of my button to .png, which I did in Photoshop, but instead of just seeing the image, then there is still a button frame or whatever you want to name.
I want the button to be simple:
there is a set of methods implemented in the API that created unecorated JButton , for example
JButton button = new JButton(); button.setBorderPainted(false); button.setBorder(null); //button.setFocusable(false); button.setMargin(new Insets(0, 0, 0, 0)); button.setContentAreaFilled(false); button.setIcon(myIcon1); button.setRolloverIcon(myIcon2); button.setPressedIcon(myIcon3); button.setDisabledIcon(myIcon4);
You just skipped a line.
i.e. btn.setBorder(null); - this is the only thing you need to do. The rest is wonderful.
btn.setBorder(null);
Add this to make it perfect: button.setFocusPainted(false);
button.setFocusPainted(false);