本文整理了Java中com.google.gwt.user.client.ui.Label.setText()
方法的一些代码示例,展示了Label.setText()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Label.setText()
方法的具体详情如下:
包路径:com.google.gwt.user.client.ui.Label
类名称:Label
方法名:setText
[英]Sets the label's content to the given text.
Doesn't change the widget's direction or horizontal alignment if directionEstimator is null. Otherwise, the widget's direction is set using the estimator, and its alignment may therefore change as described in #setText(String,com.google.gwt.i18n.client.HasDirection.Direction).
[中]将标签的内容设置为给定的文本。
如果directionEstimator为空,则不会更改小部件的方向或水平对齐。否则,将使用估计器设置小部件的方向,因此其对齐方式可能会如#setText(String,com.google.gwt.i18n.client.HasDirection.direction)中所述发生变化。
代码示例来源:origin: stackoverflow.com
// ...
@FXML private Label lblData;
// ...
public void updatePage(String data){
lblData.setText(data);
}
// ...
代码示例来源:origin: kaaproject/kaa
/**
* Set body label.
*/
public void setBodyLabelText(String text) {
if (hasLabel()) {
bodyLabel.setText(text);
}
}
代码示例来源:origin: stackoverflow.com
void initialize() {}
void initData(Customer customer) {
customerName.setText(customer.getName());
代码示例来源:origin: kaaproject/kaa
@Override
public void setTitle(String title) {
getTitileLabelWidget().setText(title);
}
代码示例来源:origin: kaaproject/kaa
@Override
public void onClick(ClickEvent event) {
if (clickCount == 1) {
navContent.add(emptyPanel);
navContent.setAnimationDuration(100);
navContent.showWidget(clickCount, new CustomAnimationCallback(true));
back.setText(CLOSE);
} else if (clickCount % 2 == 0) {
navContent.showWidget(0, new CustomAnimationCallback(false));
back.setText(OPEN);
} else {
navContent.showWidget(1, new CustomAnimationCallback(true));
back.setText(CLOSE);
}
incr();
}
});
代码示例来源:origin: stackoverflow.com
label.setText("Label 1");
bHidden.setText("Label 2");
GridData data = new GridData();
data.exclude = false;
label.setText("Label 3");
代码示例来源:origin: kaaproject/kaa
/**
* Instantiates a new HeaderViewImpl.
*/
public HeaderViewImpl() {
settingsLabel = new ActionsLabel(Utils.constants.settings());
kaaAdminStyle = Utils.kaaAdminStyle;
settingsLabel.setStyleName(kaaAdminStyle.bAppHeaderMenu());
initWidget(uiBinder.createAndBindUi(this));
signoutLabel.setText(Utils.constants.signOut());
title.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
presenter.goToHome();
}
});
}
代码示例来源:origin: com.google.gwt/gwt-servlet
/**
* Creates a label with the specified text.
*
* @param text the new label's text
*/
public Label(String text) {
this();
setText(text);
}
代码示例来源:origin: com.google.gwt/gwt-servlet
/**
* Creates a label with the specified text and direction.
*
* @param text the new label's text
* @param dir the text's direction. Note that {@code DEFAULT} means direction
* should be inherited from the widget's parent element.
*/
public Label(String text, Direction dir) {
this();
setText(text, dir);
}
代码示例来源:origin: kaaproject/kaa
/**
* Instantiates a new BaseListViewImpl.
*/
public BaseListViewImpl(boolean editable) {
this.editable = editable;
initAddButton();
errorPanel = new AlertPanel(Type.ERROR);
kaaAdminStyle = Utils.kaaAdminStyle;
avroUiStyle = Utils.avroUiStyle;
initWidget(createAndBindUi());
grid = createGrid();
dockPanel.add(grid);
titleLabel.setText(titleString());
addButton.setVisible(editable);
clearError();
}
代码示例来源:origin: stackoverflow.com
firstName.setText(firstNameString);
lastName.setText(lastNameString);
代码示例来源:origin: kaaproject/kaa
detailsView.getScope().setText(Utils.getCtlScopeTitleString(entity.getMetaInfo().getScope()));
detailsView.getCreatedUsername().setValue(entity.getCreatedUsername());
代码示例来源:origin: kaaproject/kaa
constructTopPanel();
getTitileLabelWidget().setText(Utils.constants.title());
getSaveButtonWidget().setText(Utils.constants.save());
getCancelButtonWidget().setText(Utils.constants.cancel());
getTitileLabelWidget().setText(getCreateTitle());
getCancelButtonWidget().setVisible(true);
} else {
getTitileLabelWidget().setText(getViewTitle());
getBackButtonPanelWidget().setVisible(true);
subTitleLabel.setText(getSubTitle());
代码示例来源:origin: kaaproject/kaa
private void bind(final HeaderView headerView, final EventBus eventBus) {
headerView.getUsernameLabel().setText(
KaaAdmin.getAuthInfo().getDisplayName());
registrations.add(headerView.getUsernameLabel().addClickHandler(new ClickHandler() {
代码示例来源:origin: com.google.gwt/gwt-servlet
/**
* Creates a label with the specified text and a default direction estimator.
*
* @param text the new label's text
* @param directionEstimator A DirectionEstimator object used for automatic
* direction adjustment. For convenience,
* {@link #DEFAULT_DIRECTION_ESTIMATOR} can be used.
*/
public Label(String text, DirectionEstimator directionEstimator) {
this();
setDirectionEstimator(directionEstimator);
setText(text);
}
代码示例来源:origin: stackoverflow.com
private static void doUpdate(final Display display, final Label target,
final String value) {
display.asyncExec(new Runnable() {
@Override
public void run() {
if (!target.isDisposed()) {
target.setText(value);
target.getParent().layout();
}
}
});
}
代码示例来源:origin: stackoverflow.com
Display display = new Display();
Shell shell = new Shell(display);
shell.setLayout(new GridLayout());
Label label = new Label(shell, SWT.NONE);
label.setText("I am italic");
FontData fontData = label.getFont().getFontData()[0];
Font font = new Font(display, new FontData(fontData.getName(), fontData
.getHeight(), SWT.ITALIC));
label.setFont(font);
shell.open();
while (!shell.isDisposed()) {
if (!display.readAndDispatch())
display.sleep();
}
font.dispose();
display.dispose();
代码示例来源:origin: stackoverflow.com
import javafx.fxml.FXML;
import javafx.scene.control.Label;
public class SampleController {
private int count = 0 ;
@FXML
private Label countLabel ;
@FXML
private void increment() {
count++;
countLabel.setText("Count: "+count);
}
}
代码示例来源:origin: stackoverflow.com
label.setText("Hello, World!");
代码示例来源:origin: stackoverflow.com
ScrolledComposite sc = new ScrolledComposite(parent, SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
Composite composite = new Composite(sc, SWT.NONE);
sc.setContent(composite);
Label lblRelation = new Label(composite, SWT.NONE);
lblRelation.setBounds(10, 13, 74, 15);
lblRelation.setText("Label name:");
composite.setSize(composite.computeSize(SWT.DEFAULT, SWT.DEFAULT));
内容来源于网络,如有侵权,请联系作者删除!