Here you can find the source of getbtnButton(String iconpath, String rolloverIconpath, String pressIconpath)
public static JButton getbtnButton(String iconpath, String rolloverIconpath, String pressIconpath)
//package com.java2s; //License from project: Apache License import javax.swing.ImageIcon; import javax.swing.JButton; public class Main { public static JButton getbtnButton(String iconpath, String rolloverIconpath, String pressIconpath) { JButton button = new JButton(); button.setIcon(new ImageIcon(iconpath)); button.setRolloverIcon(new ImageIcon(rolloverIconpath)); button.setPressedIcon(new ImageIcon(pressIconpath)); button.setBorder(null);/*from w w w. ja va 2 s .co m*/ button.setFocusPainted(false); button.setContentAreaFilled(false); return button; } }