本文整理汇总了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);
}
示例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);
}
示例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;
}