當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。