Java JCheckBox createCheckBox(String name, String command, boolean selected)

Here you can find the source of createCheckBox(String name, String command, boolean selected)

Description

create Check Box

License

Open Source License

Declaration

public static JCheckBox createCheckBox(String name, String command, boolean selected) 

Method Source Code

//package com.java2s;
/*/*from  ww w  .  ja  va2s.  com*/
 * ActionUtilities.java  6/7/13 2:28 PM
 *
 * Copyright (C) 2012-2013 Nick Ma
 *
 * 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.
 */

import java.awt.event.ActionListener;

import javax.swing.JCheckBox;

public class Main {
    public static JCheckBox createCheckBox(ActionListener actionListener, String name, String command,
            boolean selected) {
        JCheckBox item = new JCheckBox(name, selected);
        item.setActionCommand(command);

        if (actionListener != null) {
            item.addActionListener(actionListener);
        }

        return item;
    }

    public static JCheckBox createCheckBox(ActionListener actionListener, String name, String command) {
        return createCheckBox(actionListener, name, command, false);
    }

    public static JCheckBox createCheckBox(String name, String command, boolean selected) {
        return createCheckBox(null, name, command, selected);
    }

    public static JCheckBox createCheckBox(String name, String command) {
        return createCheckBox(null, name, command, false);
    }
}

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 s, boolean b)
  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)