java.awt.Checkbox.getLabel()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(3.9k)|赞(0)|评价(0)|浏览(184)

本文整理了Java中java.awt.Checkbox.getLabel()方法的一些代码示例,展示了Checkbox.getLabel()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Checkbox.getLabel()方法的具体详情如下:
包路径:java.awt.Checkbox
类名称:Checkbox
方法名:getLabel

Checkbox.getLabel介绍

暂无

代码示例

代码示例来源:origin: stackoverflow.com

Checkbox cb = ( Checkbox ) e.getItemSelectable();
if ( cb.getLabel().equals( "Male" ) ) {
 l1.setText( cb.getLabel() );
}
else if ( cb.getLabel().equals( "Female" ) ) {
 l2.setText( cb.getLabel() );
}

代码示例来源:origin: stackoverflow.com

Checkbox cb = cg.getSelectedCheckbox();
if(null != cb) {
 //not checked
} else {
 System.out.println(cb.getLabel() + " is checked");
}

代码示例来源:origin: org.knowhowlab.comm/org.knowhowlab.comm.rxtx-patched

output = new String( cb[i].getLabel() +
  pathSep );
out.write( output.getBytes() );

代码示例来源:origin: org.openmuc/jrxtx

output = cb[i].getLabel() +
  pathSep;
out.write( output.getBytes() );

代码示例来源:origin: mikera/tyrant

protected void doCheckboxPerformed(ItemEvent e) {
  Checkbox checkbox = (Checkbox)e.getSource();
  String key = checkbox.getLabel();
  Integer value = new Integer(checkbox.getState() ? 1 : 0);
  thing.set(key, value);
}

代码示例来源:origin: net.imagej/ij

/** Returns the selected item in the next radio button group. */
public String getNextRadioButton() {
  if (radioButtonGroups==null)
    return null;
  CheckboxGroup cg = (CheckboxGroup)(radioButtonGroups.elementAt(radioButtonIndex));
  radioButtonIndex++;
  Checkbox checkbox = cg.getSelectedCheckbox();
  String item = "null";
  if (checkbox!=null)
    item = checkbox.getLabel();
  if (macro) {
    String label = (String)labels.get((Object)cg);
    item = Macro.getValue(macroOptions, label, item);
  }
  if (recorderOn)
    recordOption(cg, item);
  return item;
}

代码示例来源:origin: imagej/ImageJA

/** Returns the selected item in the next radio button group. */
public String getNextRadioButton() {
  if (radioButtonGroups==null)
    return null;
  CheckboxGroup cg = (CheckboxGroup)(radioButtonGroups.elementAt(radioButtonIndex));
  radioButtonIndex++;
  Checkbox checkbox = cg.getSelectedCheckbox();
  String item = "null";
  if (checkbox!=null)
    item = checkbox.getLabel();
  if (macro) {
    String label = (String)labels.get((Object)cg);
    item = Macro.getValue(macroOptions, label, item);
  }
  if (recorderOn)
    recordOption(cg, item);
  return item;
}

代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/napkinlaf

descStr.append(": ").append(((Button) c).getLabel());
} else if (c instanceof Checkbox) {
  descStr.append(": ").append(((Checkbox) c).getLabel());
} else if (c instanceof Dialog) {
  descStr.append(": ").append(((Dialog) c).getTitle());

代码示例来源:origin: abbot/abbot

public static String getLabel(Component c) {
  String label = null;
  if (c instanceof JComponent) {
    Object obj =
      ((JComponent)c).getClientProperty(LABELED_BY_PROPERTY);
    // While the default is a JLabel, users may use something else as
    // the property, so be careful.
    if (obj != null) {
      if (obj instanceof JLabel) {
        label = ((JLabel)obj).getText();
      }
      else if (obj instanceof String) {
        label = (String)obj;
      }
    }
  }
  else if (c instanceof Button) {
    label = ((Button)c).getLabel();
  }
  else if (c instanceof Checkbox) {
    label = ((Checkbox)c).getLabel();
  }
  return ComponentTester.stripHTML(label);
}

代码示例来源:origin: net.java.openjdk.cacio/cacio-shared

/**
   * Receives notification when an action was performend on the button.
   * 
   * @param event
   *            the action event
   */
  public void itemStateChanged(ItemEvent event) {
    // Radiobuttons don't fire DESELECTED events...
    Checkbox awtCheckbox = getAWTComponent();
    if (event.getStateChange() == ItemEvent.DESELECTED
      && awtCheckbox.getCheckboxGroup() != null) {
      return;
    }
    awtCheckbox.setState(event.getStateChange() == ItemEvent.SELECTED);
    ItemListener[] l = awtCheckbox.getItemListeners();
    if (l.length == 0)
      return;
    ItemEvent ev = new ItemEvent(awtCheckbox,
        ItemEvent.ITEM_STATE_CHANGED, awtCheckbox.getLabel(), event
            .getStateChange());
    for (int i = 0; i < l.length; ++i)
      l[i].itemStateChanged(ev);
  }
}

代码示例来源:origin: net.java.openjdk.cacio/cacio-shared

@Override
void postInitSwingComponent() {
  super.postInitSwingComponent();
  toggleButton.addItemListener(new SwingCheckboxListener());
  Checkbox checkbox = getAWTComponent();
  setLabel(checkbox.getLabel());
  setState(checkbox.getState());
}

代码示例来源:origin: org.fudaa.edu.auburn.vgj/vgj

String label = selected.getLabel();

相关文章