Java JButton Create createSmallButton()

Here you can find the source of createSmallButton()

Description

create Small Button

License

Open Source License

Declaration

public static JButton createSmallButton() 

Method Source Code

//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;
    }
}

Related

  1. createRadioButton(String text, ButtonGroup buttonGroup, ActionListener... listeners)
  2. createRadioButton(String text, int mnemonic, ActionListener listener, boolean selected)
  3. createRadioButtonGrouping(String elements[], String title)
  4. createScreenCaptureButton()
  5. createSimpleTextButton(String caption, Action action)
  6. createSmallButton(Icon icon, String tooltip, ActionListener listener)
  7. createSquareButton(String text, int size)
  8. createStandartButton(String name)
  9. createToggleButton(ImageIcon icon, int dimension, String tooltipText, java.awt.event.ActionListener action)