you are here: codestackercodes [RSS] → tag transparent [RSS]

transparent jbutton

Insets noInsets = new Insets(0,0,0,0);
ImageIcon bg = new ImageIcon("bt1.png");
JButton btn = new JButton(bg);
btn.setBounds(0,0,32,32);
btn.setMargin(noInsets);			
btn.setBorder(BorderFactory.createEmptyBorder());
btn.setContentAreaFilled(false);
Displaying 1 Code