本文整理汇总了Java中javax.swing.JCheckBox.setText方法的典型用法代码示例。如果您正苦于以下问题:Java JCheckBox.setText方法的具体用法?Java JCheckBox.setText怎么用?Java JCheckBox.setText使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.swing.JCheckBox
的用法示例。
在下文中一共展示了JCheckBox.setText方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例4: load
import javax.swing.JCheckBox; //导入方法依赖的package包/类
private void load() {
types = new ArrayList<FoldType>(FoldUtilities.getFoldTypes(mimeType).values());
if ("".equals(mimeType)) { // NOI18N
filterUsedMimeTypes();
}
boolean override = isCollapseRedefined();
boolean currentOverride =
isDefinedLocally(PREF_OVERRIDE_DEFAULTS) ? !preferences.getBoolean(PREF_OVERRIDE_DEFAULTS, true) : false;
if (override != currentOverride) {
updateOverrideChanged();
}
for (FoldType ft : types) {
String name = ft.getLabel();
JCheckBox cb = createCheckBox(ft);
cb.setText(name);
cb.putClientProperty("id", ft.code()); // NOI18N
cb.putClientProperty("type", ft); // NOI18N
localSwitchboard.add(cb);
controls.add(cb);
cb.addItemListener(this);
}
// watch out for preferences
this.preferences.addPreferenceChangeListener(this);
updateEnabledState();
}
示例5: stateChanged
import javax.swing.JCheckBox; //导入方法依赖的package包/类
@Override
public void stateChanged(ChangeEvent e)
{
JCheckBox v_IsLike = (JCheckBox)e.getSource();
if ( v_IsLike.isSelected() )
{
v_IsLike.setText("精确");
}
else
{
v_IsLike.setText("模糊");
}
}
示例6: setupGui
import javax.swing.JCheckBox; //导入方法依赖的package包/类
protected void setupGui()
{
final JLabel canvasUrlLabel = new JLabel(getString("label.canvasurl"));
final JLabel clientIdLabel = new JLabel(getString("label.clientid"));
final JLabel secretLabel = new JLabel(getString("label.secret"));
preamble = new JLabel(getString("preamble", CANVAS_SIGNUP_URL));
preamble.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
preamble.addMouseListener(this);
canvasUrl = new JTextField(20);
clientId = new JTextField(20);
secret = new JPasswordField(20);
bypassLogon = new JCheckBox();
bypassLogon.setText(getString("label.bypasslogon"));
final LayoutManager layout = new MigLayout("wrap", "[fill][fill,grow]");
setLayout(layout);
setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
add(preamble, "span 2, gapbottom 20");
add(canvasUrlLabel);
add(canvasUrl);
add(clientIdLabel);
add(clientId);
add(secretLabel);
add(secret);
add(bypassLogon, "span 2");
validate();
}
示例7: LoadFromParalelDialog
import javax.swing.JCheckBox; //导入方法依赖的package包/类
public LoadFromParalelDialog(final JFrame frame, Engine engine) {
super(frame, true);
setTitle("loadFromParalel");
JPanel qPanel = new JPanel();
qPanel.setLayout(new BoxLayout(qPanel, BoxLayout.Y_AXIS));
//qPanel.setLayout(new FlowLayout());
List<Qualifier> list = engine.getQualifiers();
for (Qualifier qualifier : list) {
if (IDEF0Plugin.isFunction(qualifier)) {
qualifiers.add(qualifier);
JCheckBox box = new JCheckBox();
box.setText(qualifier.getName());
boxes.add(box);
qPanel.add(box);
}
}
JScrollPane pane = new JScrollPane();
panel.add(pane, BorderLayout.CENTER);
JPanel p = new JPanel(new FlowLayout(FlowLayout.LEFT));
p.add(importAllClasificators);
panel.add(p, BorderLayout.SOUTH);
setMainPane(panel);
ResourceLoader.setJComponentsText(this);
pane.setViewportView(qPanel);
pack();
centerDialog();
Options.loadOptions("loadFromParalel", this);
}
示例8: checkbox
import javax.swing.JCheckBox; //导入方法依赖的package包/类
protected JCheckBox checkbox(String name, boolean selected)
{
JCheckBox rb = new JCheckBox(name);
rb.setActionCommand(name);
rb.setText("");
rb.setSelected(selected);
checks.put(name, rb);
return rb;
}
示例9: initComponents
import javax.swing.JCheckBox; //导入方法依赖的package包/类
/**
* Initialize layout
*/
private void initComponents() {
//building mainPanel
this.setLayout(new GridLayout(2, 1));
this.setBorder(new EmptyBorder(5, 5, 5, 5));
//layout of block panel
JPanel block = new JPanel(new BorderLayout(10, 10));
block.setBorder(new TitledBorder(new EtchedBorder(), "Fork-Join Section Capacity"));
this.add(block);
// Adds a checkbox to block panel to select block function
final JCheckBox check = new JCheckBox();
check.setText("Enable Finite Capacity: limit maximum number of jobs (customers) inside a fork-join section");
check.setToolTipText("Limit the maximum number of jobs allowed inside a fork-join section. Following jobs will be queued.");
// Adds a spinner to block panel to select block number
JLabel label = new JLabel("Capacity (max number of jobs, NOT tasks): ");
label.setLabelFor(blockSpinner);
// Initial values
if (sd.getForkBlock(stationKey).intValue() < 0) {
check.setSelected(false);
blockSpinner.setValue(Float.POSITIVE_INFINITY);
blockSpinner.setEnabled(false);
} else {
check.setSelected(true);
blockSpinner.setValue(sd.getForkBlock(stationKey));
blockSpinner.setEnabled(true);
}
// Adds action listeners
check.addActionListener(new ActionListener() {
/**
* Toggles block property
*/
public void actionPerformed(ActionEvent e) {
if (check.isSelected()) {
if (Defaults.getAsInteger("forkBlock").intValue() > 0) {
sd.setForkBlock(stationKey, Defaults.getAsInteger("forkBlock"));
} else {
sd.setForkBlock(stationKey, new Integer(1));
}
blockSpinner.setValue(sd.getForkBlock(stationKey));
blockSpinner.setEnabled(true);
} else {
sd.setForkBlock(stationKey, new Integer(-1));
blockSpinner.setValue(Float.POSITIVE_INFINITY);
blockSpinner.setEnabled(false);
}
}
});
// Creates a temp panel for blockSpinner and its label
JPanel tmp = new JPanel();
tmp.add(label);
tmp.add(blockSpinner);
block.add(check, BorderLayout.NORTH);
block.add(tmp, BorderLayout.CENTER);
}
示例10: initComponents
import javax.swing.JCheckBox; //导入方法依赖的package包/类
/**
* Initialize layout
*/
private void initComponents() {
//building mainPanel
this.setLayout(new GridLayout(2, 1));
this.setBorder(new EmptyBorder(5, 5, 5, 5));
//layout of fragNum panel
JPanel fragnum = new JPanel();
fragnum.setBorder(new TitledBorder(new EtchedBorder(), "Fork degree"));
this.add(fragnum);
JLabel text = new JLabel("Number of Forked-Jobs to be generated on each output link for each input job (customer) to the Fork:");
text.setLabelFor(numForkSpinner);
fragnum.add(text);
fragnum.add(numForkSpinner);
//layout of block panel
JPanel block = new JPanel(new BorderLayout(10, 10));
block.setBorder(new TitledBorder(new EtchedBorder(), "Fork-Join Section Capacity"));
this.add(block);
// Adds a checkbox to block panel to select block function
final JCheckBox check = new JCheckBox();
check.setText("Enable Finite Capacity: limit maximum number of jobs (customers) inside a fork-join section. ");
check.setToolTipText("Limit the maximum allowed number of jobs inside a fork-join section. Following jobs will be queued.");
// Adds a spinner to block panel to select block number
JLabel label = new JLabel("Capacity (max number of jobs, NOT Forked-Jobs): ");
label.setLabelFor(blockSpinner);
// Initial values
if (sd.getForkBlock(stationKey).intValue() < 0) {
check.setSelected(false);
blockSpinner.setValue(new Float(Float.POSITIVE_INFINITY));
blockSpinner.setEnabled(false);
} else {
check.setSelected(true);
blockSpinner.setValue(sd.getForkBlock(stationKey));
blockSpinner.setEnabled(true);
}
// Adds action listeners
check.addActionListener(new ActionListener() {
/**
* Toggles block property
*/
public void actionPerformed(ActionEvent e) {
if (check.isSelected()) {
if (Defaults.getAsInteger("forkBlock").intValue() > 0) {
sd.setForkBlock(stationKey, Defaults.getAsInteger("forkBlock"));
} else {
sd.setForkBlock(stationKey, new Integer(1));
}
blockSpinner.setValue(sd.getForkBlock(stationKey));
blockSpinner.setEnabled(true);
} else {
sd.setForkBlock(stationKey, new Integer(-1));
blockSpinner.setValue(new Float(Float.POSITIVE_INFINITY));
blockSpinner.setEnabled(false);
}
}
});
// Creates a temp panel for blockSpinner and its label
JPanel tmp = new JPanel();
tmp.add(label);
tmp.add(blockSpinner);
block.add(check, BorderLayout.NORTH);
block.add(tmp, BorderLayout.CENTER);
}