本文整理匯總了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;
}