Java JCheckBox createCheckBox(String s, boolean b)

Here you can find the source of createCheckBox(String s, boolean b)

Description

Builds a personalized checkbox using a smaller than usual font.

License

GNU General Public License

Declaration

static JCheckBox createCheckBox(String s, boolean b) 

Method Source Code

//package com.java2s;
/**/*from   w  w  w  . j  ava  2  s . c  om*/
 *    Includes coding developed for Centre d'Informatique Geologique
 *    by J.V.Lee priory 2000 GNU license.
 *
 *    This program is free software; you can redistribute it and/or modify it under the terms
 *    of the GNU General Public License as published by the Free Software Foundation; either
 *    version 3 of the License, or any later version.
 *
 *    This program 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 General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License along with this program;
 *    if not, see <http://www.gnu.org/licenses>.
 *
 *    Additional permission under GNU GPL version 3 section 7:
 *    If you have received this program as a library with written permission from the DataMelt team,
 *    you can link or combine this library with your non-GPL project to convey the resulting work.
 *    In this case, this library should be considered as released under the terms of
 *    GNU Lesser public license (see <https://www.gnu.org/licenses/lgpl.html>),
 *    provided you include this license notice and a URL through which recipients can access the
 *    Corresponding Source.
 **/

import java.awt.*;
import javax.swing.*;

public class Main {
    /**
     * Builds a personalized checkbox using a smaller than usual font.
     */
    static JCheckBox createCheckBox(String s, boolean b) {
        JCheckBox cb = new JCheckBox(" " + s + " ", b);
        cb.setFont(new Font("serif", Font.PLAIN, 12));
        cb.setHorizontalAlignment(JCheckBox.LEFT);
        return cb;
    }
}

Related

  1. addCheckBox(Container container, String label, String placement, boolean debug)
  2. convertToYesNo(JCheckBox checkBox)
  3. createCheckBox(final String title, final Preferences node, final String pref_name, final boolean default_val)
  4. createCheckBox(String name, String command, boolean selected)
  5. createJCheckBox(Rectangle bounds)
  6. exclusive(final JCheckBox first, final boolean firstState, final JCheckBox second, final boolean secondState)
  7. imply(final JCheckBox checked, final boolean checkedState, final JCheckBox changed, final boolean impliedState)
  8. initJCheckBox(JCheckBox box, String element)