本文整理汇总了Java中javafx.scene.control.Labeled.setText方法的典型用法代码示例。如果您正苦于以下问题:Java Labeled.setText方法的具体用法?Java Labeled.setText怎么用?Java Labeled.setText使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javafx.scene.control.Labeled
的用法示例。
在下文中一共展示了Labeled.setText方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: replaceFileTypeNameTagInLabeledControls
import javafx.scene.control.Labeled; //导入方法依赖的package包/类
/**
* Replaces <filetype> tags in this {@link MultiSourceFileListerController}'s view to a
* specified text. Should be invoked before
* {@link #bindToMultiSourceFileLister(MultiSourceFilePicker, MultiSourceFilePicker)} method.
*
* @param fileTypeName
* The text to use instead of <filetype> tags in texts of {@link Label}s. Should
* describe in one or two words the type of files this
* MultiSourceFilePickerController accepts (not extension).
* @throws RuntimeException
* if it was already invoked and replaced the text in Labels.
*/
public void replaceFileTypeNameTagInLabeledControls(String fileTypeName) {
if (this.fileTypeName == null) {
this.fileTypeName = fileTypeName;
for (Node node : ((GridPane) getView()).getChildren()) {
if (node instanceof Labeled) {
Labeled labeled = (Labeled) node;
labeled.setText(labeled.getText().replace("<filetype>", fileTypeName));
}
}
manualPaneDotsAnima.setAdditionalText(
manualPaneDotsAnima.getAdditionalText().replace("<filetype>", fileTypeName));
} else {
throw new RuntimeException("File type name tag is already replaced.");
}
}
示例2: createCase1
import javafx.scene.control.Labeled; //导入方法依赖的package包/类
private Labeled createCase1(Labeled labeled) {
labeled.setText(TEXT);
labeled.setTextOverrun(def);
labeled.setEllipsisString(ELLIPSIS1);
return labeled;
}
示例3: temporaryLabeledUpdate
import javafx.scene.control.Labeled; //导入方法依赖的package包/类
public static void temporaryLabeledUpdate(int mseconds, Labeled labeled, String newText) {
String oldText = labeled.getText();
labeled.setText(newText);
callAfter(mseconds, new CallbackVisitor() {
@Override
public void call() {
labeled.setText(oldText);
}
});
}
示例4: initAnimation
import javafx.scene.control.Labeled; //导入方法依赖的package包/类
private void initAnimation(final Labeled digitalClock) {
// the digital clock updates once a second.
final Timeline digitalTime = new Timeline(new KeyFrame(
Duration.seconds(0), new EventHandler<ActionEvent>() {
@Override
public void handle(ActionEvent actionEvent) {
Calendar calendar = GregorianCalendar.getInstance();
String hourString = pad(2, '0',
calendar.get(Calendar.HOUR) == 0 ? "12"
: calendar.get(Calendar.HOUR) + "");
String minuteString = pad(2, '0',
calendar.get(Calendar.MINUTE) + "");
String secondString = pad(2, '0',
calendar.get(Calendar.SECOND) + "");
String ampmString = calendar.get(Calendar.AM_PM) == Calendar.AM ? "AM"
: "PM";
digitalClock.setText(hourString + ":" + minuteString
+ ":" + secondString + " " + ampmString);
}
}), new KeyFrame(Duration.seconds(1)));
// time never ends.
digitalTime.setCycleCount(Animation.INDEFINITE);
// start the analogueClock.
digitalTime.play();
}
示例5: setLineNumber
import javafx.scene.control.Labeled; //导入方法依赖的package包/类
protected void setLineNumber(Labeled c, int ix)
{
String s = editor.getLineNumberFormatter().format(ix + 1);
c.setText(s);
}
示例6: createCase2
import javafx.scene.control.Labeled; //导入方法依赖的package包/类
private Labeled createCase2(Labeled labeled) {
labeled.setText(TEXT);
labeled.setTextOverrun(def);
labeled.setEllipsisString(ELLIPSIS2);
return labeled;
}
示例7: createCase3
import javafx.scene.control.Labeled; //导入方法依赖的package包/类
private Labeled createCase3(Labeled labeled) {
labeled.setText(TEXT);
labeled.setTextOverrun(def);
labeled.setEllipsisString(ELLIPSIS3);
return labeled;
}