当前位置: 首页>>代码示例>>Java>>正文


Java JCheckBox.setName方法代码示例

本文整理汇总了Java中javax.swing.JCheckBox.setName方法的典型用法代码示例。如果您正苦于以下问题:Java JCheckBox.setName方法的具体用法?Java JCheckBox.setName怎么用?Java JCheckBox.setName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javax.swing.JCheckBox的用法示例。


在下文中一共展示了JCheckBox.setName方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: addRoundRobin

import javax.swing.JCheckBox; //导入方法依赖的package包/类
/**
 * Adds a Round-Robin checkbox to an interval panel
 * 
 * @param intervalPanel
 *            the interval panel
 * @author Federico Dal Castello
 */
protected void addRoundRobin(Container intervalPanel) {
	JCheckBox roundRobinCheckBox = new JCheckBox();
	roundRobinCheckBox.setText(ROUND_ROBIN + " (A-B-A-B-A-B-A-B...)");
	roundRobinCheckBox.setName(ROUND_ROBIN);

	Boolean isChecked = (Boolean) current.getParameter(5).getValue();
	roundRobinCheckBox.setSelected(isChecked.booleanValue());
	roundRobinCheckBox.addActionListener(new RoundRobinAdapter());

	// the checkbox will be aligned to the left
	GridBagConstraints c = new GridBagConstraints();
	c.fill = GridBagConstraints.HORIZONTAL;
	c.weightx = 1.0;
	c.weighty = 0.0;

	// Add the distribution
	intervalPanel.add(roundRobinCheckBox, c);
}
 
开发者ID:max6cn,项目名称:jmt,代码行数:26,代码来源:DistributionsEditor.java

示例2: addRoundRobin

import javax.swing.JCheckBox; //导入方法依赖的package包/类
/**
 * Adds a Round-Robin checkbox to an interval panel
 * @param intervalPanel the interval panel
 * @author Federico Dal Castello
 */
protected void addRoundRobin(Container intervalPanel) {

	JCheckBox roundRobinCheckBox = new JCheckBox();
	roundRobinCheckBox.setText(ROUND_ROBIN + " (A-B-A-B-A-B-A-B...)");
	roundRobinCheckBox.setName(ROUND_ROBIN);

	Boolean isChecked = (Boolean) current.getParameter(5).getValue();
	roundRobinCheckBox.setSelected(isChecked.booleanValue());

	roundRobinCheckBox.addActionListener(new RoundRobinAdapter());

	//the checkbox will be aligned to the left
	GridBagConstraints c = new GridBagConstraints();
	c.fill = GridBagConstraints.HORIZONTAL;
	c.weightx = 1.0;
	c.weighty = 0.0;

	//Add the distribution
	intervalPanel.add(roundRobinCheckBox, c);
}
 
开发者ID:HOMlab,项目名称:QN-ACTR-Release,代码行数:26,代码来源:DistributionsEditor.java

示例3: getThumbSelector

import javax.swing.JCheckBox; //导入方法依赖的package包/类
/**
 * create returns the thumb selector component
 *
 * @param f
 * @return
 */
private JComponent getThumbSelector(final String f) {
    final JCheckBox cb = new JCheckBox();
    cb.setText("");
    cb.setSelected(false);
    cb.setName(f);
    cb.addActionListener(new ActionListener() {

        @Override
        public void actionPerformed(ActionEvent e) {
            if (cb.isSelected()) {
                selflist.add(f);
            } else {
                selflist.remove(f);
            }
        }
    });
    cb.setPreferredSize(CB_SIZE);
    return cb;

}
 
开发者ID:CognizantQAHub,项目名称:Cognizant-Intelligent-Test-Scripter,代码行数:27,代码来源:ImageGallery.java


注:本文中的javax.swing.JCheckBox.setName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。