Here you can find the source of createSmallButton()
public static JButton createSmallButton()
//package com.java2s; /******************************************************************************* * Copyright (c) 2011 Zeljko Zirikovic.// w w w. j a va 2 s . c om * All rights reserved. This program and the accompanying materials * are made available under the terms of the GPL which * accompanies this distribution, and is available at * http://www.gnu.org/licenses/gpl.html ******************************************************************************/ import javax.swing.JButton; import javax.swing.SwingConstants; import javax.swing.border.EmptyBorder; public class Main { public static JButton createSmallButton() { JButton button = new JButton(); button.setBorderPainted(false); button.setBorder(new EmptyBorder(0, 1, 0, 1)); button.setContentAreaFilled(false); button.setFocusPainted(false); button.setRolloverEnabled(true); button.setHorizontalAlignment(SwingConstants.CENTER); return button; } }