Here you can find the source of setTransparent(JButton btn)
public static void setTransparent(JButton btn)
//package com.java2s; //License from project: Open Source License import javax.swing.JButton; public class Main { public static void setTransparent(JButton btn) { btn.setOpaque(false);/*from w w w . j a v a 2 s . c o m*/ btn.setContentAreaFilled(false); btn.setBorderPainted(false); btn.setBorder(null); } }