Java JButton Create createJButton(String label, Font font)

Here you can find the source of createJButton(String label, Font font)

Description

Creates a JButton .

License

Open Source License

Parameter

Parameter Description
label the label.
font the font.

Return

The button.

Declaration

public static JButton createJButton(String label, Font font) 

Method Source Code

//package com.java2s;
/* ===========================================================
 * JFreeChart : a free chart library for the Java(tm) platform
 * ===========================================================
 *
 * (C) Copyright 2000-2017, by Object Refinery Limited and Contributors.
 *
 * Project Info:  http://www.jfree.org/jfreechart/index.html
 *
 * This library is free software; you can redistribute it and/or modify it
 * under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation; either version 2.1 of the License, or
 * (at your option) any later version./*  w  w  w  .j a va 2 s  . co  m*/
 *
 * This library is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
 * License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301,
 * USA.
 *
 * [Oracle and Java are registered trademarks of Oracle and/or its affiliates. 
 * Other names may be trademarks of their respective owners.]
 *
 */

import java.awt.Font;

import javax.swing.JButton;

public class Main {
    /**
     * Creates a {@link JButton}.
     *
     * @param label  the label.
     * @param font  the font.
     *
     * @return The button.
     */
    public static JButton createJButton(String label, Font font) {
        JButton result = new JButton(label);
        result.setFont(font);
        return result;
    }
}

Related

  1. createHyperlinkButton(String text, String tip, ActionListener action)
  2. createIconButton(Class klass, String resource, String fallbackText)
  3. createIconButton(ImageIcon icon, int dimension, String tooltipText, java.awt.event.ActionListener action)
  4. createJButton(Container c, String caption, int x, int y, int width, int height, ActionListener al)
  5. createJButton(final String label, final Font font)
  6. createJButton(String text, String name, ActionListener a)
  7. createLabelButton(String text)
  8. createListButton(Action action)
  9. createNoURLGraphicalButton(String imageName, String alternateText)