本文整理了Java中javafx.scene.control.Button.setText()
方法的一些代码示例,展示了Button.setText()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Button.setText()
方法的具体详情如下:
包路径:javafx.scene.control.Button
类名称:Button
方法名:setText
暂无
代码示例来源:origin: it.unibo.alchemist/alchemist-projectview
/**
*
*/
public void initialize() {
this.next.setText(RESOURCES.getString("next"));
this.next.setDisable(true);
this.selectFolder.setText(RESOURCES.getString("select_folder"));
}
代码示例来源:origin: com.github.vatbub/common.view.core
private void updateText() {
String finalText;
if (!this.progressText.equals("")) {
finalText = this.progressText;
} else {
finalText = "";
}
if (!this.progressText.equals("") && !this.controlText.equals("")) {
// Add -
finalText = finalText + " - ";
}
// add the controlText
finalText = finalText + controlText;
super.setText(finalText);
}
}
代码示例来源:origin: it.unibo.alchemist/alchemist-projectview
/**
*
*/
public void initialize() {
this.btnCancel.setText(RESOURCES.getString("cancel"));
this.btnOk.setText(RESOURCES.getString("ok"));
this.fileName.setText(RESOURCES.getString("file_name"));
this.tfNameFile.setPromptText(RESOURCES.getString("enter_file_name"));
}
代码示例来源:origin: it.unibo.alchemist/alchemist-projectview
private void setField(final String label, final String textField) {
this.label.setText(label);
this.textField.setPromptText(textField);
this.okBtn.setText(RESOURCES.getString("ok"));
this.cancelBtn.setText(RESOURCES.getString("cancel"));
}
代码示例来源:origin: com.nexitia.emaginplatform/emagin-jfxcore-engine
public void toUpperCase() {
button.setText(button.getText().toUpperCase());
}
}
代码示例来源:origin: com.nexitia.emaginplatform/emagin-jfxcore-engine
public void toUpperCase() {
button.setText(button.getText().toUpperCase());
}
}
代码示例来源:origin: com.vektorsoft.demux.desktop/demux-desktop
@Override
public void onLocaleChange() {
switch (options) {
case DMXDialog.OPTIONS_OK:
buttons[0].setText(resourceManager.getString("dialog.button.ok"));
break;
case DMXDialog.OPIONS_OK_CANCEL:
buttons[0].setText(resourceManager.getString("dialog.button.ok"));
buttons[1].setText(resourceManager.getString("dialog.button.cancel"));
break;
case DMXDialog.OPTIONS_YES_NO:
buttons[0].setText(resourceManager.getString("dialog.button.yes"));
buttons[1].setText(resourceManager.getString("dialog.button.no"));
break;
case DMXDialog.OPTIONS_YES_NO_CANCEL:
buttons[0].setText(resourceManager.getString("dialog.button.yes"));
buttons[1].setText(resourceManager.getString("dialog.button.no"));
buttons[2].setText(resourceManager.getString("dialog.button.cancel"));
break;
default:
}
}
代码示例来源:origin: com.nexitia.emaginplatform/emagin-jfxcore-engine
@Override
protected void failed() {
super.failed();
Platform.runLater(() -> {
button.setText("--");
});
}
代码示例来源:origin: com.nexitia.emaginplatform/emagin-jfxcore-engine
@Override
protected void setException(Throwable t) {
super.setException(t);
Platform.runLater(() -> {
button.setText("--");
});
}
};
代码示例来源:origin: com.github.vatbub/common.updater
@Override
public void operationCanceled() {
Platform.runLater(() -> {
updateProgressAnimation.setVisible(false);
updateProgressText.setVisible(false);
okButton.setText(bundle.getString("button.ok"));
okButton.setDisable(false);
cancelButton.setText(bundle.getString("button.cancel"));
updateProgressBar.setVisible(false);
});
}
代码示例来源:origin: com.nexitia.emaginplatform/emagin-jfxcore-engine
@Override
protected Void call() throws Exception {
getCurrentUserOperation.doOperation(new JsonObject(), res -> {
Platform.runLater(() -> {
button.setText((String) ((OperationData) res.rootData()).getAttributes().get("nickName"));
});
});
return null;
}
代码示例来源:origin: it.unibo.alchemist/alchemist-projectview
/**
*
*/
public void initialize() {
this.backBtn.setText(RESOURCES.getString("back"));
this.finishBtn.setText(RESOURCES.getString("finish"));
this.finishBtn.setDisable(true);
this.select.setText(RESOURCES.getString("select"));
this.choiceTempl.setItems(TEMPLATES);
this.choiceTempl.getSelectionModel().selectedItemProperty().addListener((observable, oldValue, newValue) -> {
selectedTemplate = newValue;
finishBtn.setDisable(false);
});
}
代码示例来源:origin: com.github.vatbub/common.updater
@FXML
void okButtonOnAction(ActionEvent event) {
UpdateAvailableDialog t = this;
okButton.setDisable(true);
cancelButton.setText(bundle.getString("button.cancel.cancelDownload"));
downloadThread = new Thread(() -> {
try {
boolean res = UpdateChecker.downloadAndInstallUpdate(updateInfo, t);
if (res) {
t.hide();
}
} catch (IllegalStateException | IOException e) {
showErrorMessage(e.getLocalizedMessage());
e.printStackTrace();
}
});
downloadThread.start();
}
代码示例来源:origin: it.unibo.alchemist/alchemist-projectview
/**
*
*/
public void initialize() {
SVGImageUtils.installSvgLoader();
this.btnNew.setGraphic(new ImageView(SVGImageUtils.getSvgImage("icon/new.svg", IMG_WIDTH, IMG_HEIGHT)));
this.btnNew.setText(RESOURCES.getString("new"));
this.btnOpen.setGraphic(new ImageView(SVGImageUtils.getSvgImage("icon/open.svg", IMG_WIDTH, IMG_HEIGHT)));
this.btnOpen.setText(RESOURCES.getString("open"));
this.btnSave.setGraphic(new ImageView(SVGImageUtils.getSvgImage("icon/save.svg", IMG_WIDTH, IMG_HEIGHT)));
this.btnSave.setText(RESOURCES.getString("save"));
this.btnSave.setDisable(true);
}
代码示例来源:origin: com.github.vatbub/common.updater
public void showErrorMessage(String message) {
Platform.runLater(() -> {
detailsLabel.setText("An error occurred:\n" + message);
updateProgressAnimation.setVisible(false);
updateProgressText.setVisible(false);
okButton.setDisable(false);
okButton.setText(bundle.getString("button.ok.retry"));
updateProgressBar.setVisible(false);
});
}
}
代码示例来源:origin: it.unibo.alchemist/alchemist-projectview
/**
*
*/
public void initialize() {
SVGImageUtils.installSvgLoader();
this.run.setGraphic(new ImageView(SVGImageUtils.getSvgImage("icon/run.svg", RUN_WIDTH, RUN_HEIGHT)));
this.run.setText(RESOURCES.getString("run"));
this.run.setDisable(true);
this.folder = SVGImageUtils.getSvgImage("icon/folder.svg", TREE_ICON_WIDTH, TREE_ICON_HEIGHT);
this.file = SVGImageUtils.getSvgImage("icon/file.svg", TREE_ICON_WIDTH, TREE_ICON_HEIGHT);
}
代码示例来源:origin: com.nexitia.emaginplatform/emagin-jfxcore-engine
private void buildActions() {
okButton.getStyleClass().addAll("button-transparent-border-transparent");
okButton.setDefaultButton(true);
okButton.setText(controller.getGLocalised("DONE_LABEL").toUpperCase());
cancelButton.getStyleClass().addAll("button-transparent-border-transparent");
cancelButton.setText(controller.getGLocalised("CANCEL_LABEL").toUpperCase());
actions.getStyleClass().add("form-actions-inline-editor-wrapper");
actions.getChildren().addAll(NodeHelper.horizontalSpacer(), cancelButton, okButton);
allOverContainer.getChildren().add(actions);
VBox.setMargin(actions, new Insets(16, 0, 0, 0));
cancelButton.setOnAction(e -> onCancel());
okButton.setOnAction(e -> onOk());
}
代码示例来源:origin: com.nexitia.emaginplatform/emagin-jfxcore-engine
/**
* Build done button
*/
private void buildDoneButton() {
doneButton.getStyleClass().addAll("button-small", "table-toolbar-action", "ep-button");
doneButton.setOnAction(e -> modifyClicked(controller));
doneButton.setText(controller.getGLocalised("DONE_LABEL").toUpperCase());
IconUtils.setFontIcon("fa-check:16", doneButton);
modifyingActionsWrapper.getChildren().addAll(NodeHelper.horizontalSpacer(), doneButton);
}
代码示例来源:origin: net.sf.gluebooster.java.booster/gb-basic
@Override
public void start(Stage primaryStage) {
primaryStage.setTitle("Hello World!");
Button btn = new Button();
btn.setText("Say 'Hello World'");
btn.setOnAction(new EventHandler<ActionEvent>() {
@Override
public void handle(ActionEvent event) {
System.out.println("Hello World!");
}
});
StackPane root = new StackPane();
root.getChildren().add(btn);
primaryStage.setScene(new Scene(root, 300, 250));
primaryStage.show();
}
}
代码示例来源:origin: com.nexitia.emaginplatform/emagin-jfxcore-engine
/**
* Build the modify button.
*/
private void buildModifyButton() {
modifyButton.getStyleClass().addAll("table-toolbar-action", "ep-button");
modifyButton.setOnAction(e -> modifyClicked(controller));
modifyButton.setText(controller.getGLocalised("EDIT_LABEL").toUpperCase());
IconUtils.setFontIcon("gmi-more-horiz:18", modifyButton);
allOverWrapper.getChildren().add(modifyButton);
if (selectable.get()) {
//thickButton.setOnAction(e -> thickClicked());
//modifyingActionsWrapper.getChildren().add(0, thickButton);
}
NodeHelper.setHgrow(modifyingActionsWrapper);
modifyingActionsWrapper.visibleProperty().bind(((IModifiableToolbarHolder) toolbarHolder).modifyingProperty());
modifyingActionsWrapper.managedProperty().bind(modifyingActionsWrapper.visibleProperty());
rootContainer.getChildren().add(modifyingActionsWrapper);
}
内容来源于网络,如有侵权,请联系作者删除!