本文整理了Java中com.google.gwt.user.client.ui.CheckBox.setText()
方法的一些代码示例,展示了CheckBox.setText()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。CheckBox.setText()
方法的具体详情如下:
包路径:com.google.gwt.user.client.ui.CheckBox
类名称:CheckBox
方法名:setText
暂无
代码示例来源:origin: stackoverflow.com
View checkBoxView = View.inflate(this, R.layout.checkbox, null);
CheckBox checkBox = (CheckBox) checkBoxView.findViewById(R.id.checkbox);
checkBox.setOnCheckedChangeListener(new OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
// Save to shared preferences
}
});
checkBox.setText("Text to the right of the check box.");
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setTitle(" MY_TEXT");
builder.setMessage(" MY_TEXT ")
.setView(checkBoxView)
.setCancelable(false)
.setPositiveButton("Yes", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
Uri uri = Uri.parse("market://details?id=MY_APP_PACKAGE");
Intent intent = new Intent (Intent.ACTION_VIEW, uri);
startActivity(intent); }
})
.setNegativeButton("No", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
dialog.cancel();
}
}).show();
代码示例来源:origin: stackoverflow.com
final LinearLayout attractedTo = (LinearLayout) findViewById(R.id.register_attracted_to);
final CheckBox male = new CheckBox(this);
male.setText("Male");
male.setTextColor(getResources().getColor(R.color.foreground_text));
attractedTo.addView(male);
final CheckBox female = new CheckBox(this);
female.setText("Female");
female.setTextColor(getResources().getColor(R.color.foreground_text));
attractedTo.addView(female);
代码示例来源:origin: com.google.gwt/gwt-servlet
/**
* Creates a check box with the specified text label.
*
* @param label the check box's label
* @param dir the text's direction. Note that {@code DEFAULT} means direction
* should be inherited from the widget's parent element.
*/
public CheckBox(String label, Direction dir) {
this();
setText(label, dir);
}
代码示例来源:origin: com.google.gwt/gwt-servlet
/**
* Creates a check box with the specified text label.
*
* @param label the check box's label
*/
public CheckBox(String label) {
this();
setText(label);
}
代码示例来源:origin: stackoverflow.com
b.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
for(int i = 0; i < 20; i++) {
CheckBox cb = new CheckBox(getApplicationContext());
cb.setText("I'm dynamic!");
ll.addView(cb);
}
}
});
代码示例来源:origin: com.google.gwt/gwt-servlet
/**
* Creates a label with the specified text and a default direction estimator.
*
* @param label the check box's label
* @param directionEstimator A DirectionEstimator object used for automatic
* direction adjustment. For convenience,
* {@link #DEFAULT_DIRECTION_ESTIMATOR} can be used.
*/
public CheckBox(String label, DirectionEstimator directionEstimator) {
this();
setDirectionEstimator(directionEstimator);
setText(label);
}
代码示例来源:origin: com.google.gwt/gwt-servlet
/**
* Creates a check box with the specified text label.
*
* @param label the check box's label
* @param asHTML <code>true</code> to treat the specified label as html
*/
public CheckBox(@IsSafeHtml String label, boolean asHTML) {
this();
if (asHTML) {
setHTML(label);
} else {
setText(label);
}
}
代码示例来源:origin: com.vaadin.external.gwt/gwt-user
/**
* Creates a check box with the specified text label.
*
* @param label the check box's label
*/
public CheckBox(String label) {
this();
setText(label);
}
代码示例来源:origin: com.vaadin.external.gwt/gwt-user
/**
* Creates a check box with the specified text label.
*
* @param label the check box's label
* @param dir the text's direction. Note that {@code DEFAULT} means direction
* should be inherited from the widget's parent element.
*/
public CheckBox(String label, Direction dir) {
this();
setText(label, dir);
}
代码示例来源:origin: stackoverflow.com
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.menu_main, menu);
CheckBox checkBox = (CheckBox) menu.findItem(R.id.menuShowDue).getActionView();
checkBox.setText("Sample Text");
return true;
}
代码示例来源:origin: stackoverflow.com
btn.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
for(int i = 0; i < 20; i++) {
CheckBox cb = new CheckBox(getApplicationContext());
cb.setText("I'm dynamic!");
lil.addView(cb);
}
}
});
代码示例来源:origin: stackoverflow.com
ArrayList<CheckBox> checkboxes = new ArrayList<CheckBox>();
for (String s : dataArray) {
CheckBox cBox = new CheckBox(myContext); //or inflate it from xml if you have a defined style
cBox.setText(s);
checkboxes.add(cBox);
}
代码示例来源:origin: org.jboss.errai/errai-bus
showFurtherErrors.setText("Show further errors");
showFurtherErrors.getElement().getStyle().setFontSize(10, Style.Unit.PT);
showFurtherErrors.getElement().getStyle().setColor("white");
代码示例来源:origin: stackoverflow.com
TextView message = new TextView(context);
message.setText(context.getString(R.string.msg_photo_caution));
CheckBox do_not_show_this_again = new CheckBox(context);
do_not_show_this_again.setText(context.getString(R.string.msg_dont_show_again));
LinearLayout layout = new LinearLayout(context);
layout.setOrientation(LinearLayout.VERTICAL);
layout.addView(message);
layout.addView(do_not_show_this_again);
dialogBack.setView(layout);
代码示例来源:origin: stackoverflow.com
LinearLayout my_layout = (LinearLayout)findViewById(R.id.my_layout);
button.setOnClickListener(new onClickListener(){
void onClick(){
CheckBox checkBox = new CheckBox(this);
checkBox.setText(Str_Array[i]);
my_layout.addView(checkBox);
}
});
代码示例来源:origin: stackoverflow.com
private LinearLayyout ll = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
params.leftMargin = 123;;
CheckBox cb;
for(int i = 0; i < 10; i++) {
cb = new CheckBox(this);
cb.setText(categoryListArray[i]);
ll.addView(cb, ll);
}
代码示例来源:origin: stackoverflow.com
if (type == TYPE.CHECKBOXES){
LinearLayout myPanel = new LinearLayout(this);
for (int i = 0; i < n ; i++){
CheckBox chk=new CheckBox(this);
chk.setText("Hello");
myPanel.addView(chk);
}
myRootPanel.addView(myPanel);
}
代码示例来源:origin: stackoverflow.com
for (int i = 0; i < items.size(); i++) {
CheckBox cb = new CheckBox(this);
cb.setText(String.valueOf(items.get(i)));
cb.setId(items.get(i));
ll.addView(cb);
}
代码示例来源:origin: oVirt/ovirt-engine
@Override
public void setLabel(String label) {
if (useCheckBoxWidgetLabel) {
asCheckBox().setText(label);
} else {
super.setLabel(label);
}
}
代码示例来源:origin: stackoverflow.com
TableLayout tl=new TableLayout(this);
TableRow tr=new TableRow(this);
CheckBox chk=new CheckBox(this);
chk.setText("Hello");
tr.addView(chk);
tl.addView(tr);
setContentView(tl);
内容来源于网络,如有侵权,请联系作者删除!