本文整理汇总了Java中javafx.scene.control.TextArea.setFont方法的典型用法代码示例。如果您正苦于以下问题:Java TextArea.setFont方法的具体用法?Java TextArea.setFont怎么用?Java TextArea.setFont使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javafx.scene.control.TextArea
的用法示例。
在下文中一共展示了TextArea.setFont方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: StepPanel
import javafx.scene.control.TextArea; //导入方法依赖的package包/类
public StepPanel(AppSession session, StepWrapper step) {
this.session = session;
runButton = new Button("►");
textArea = new TextArea();
textArea.setFont(App.getDefaultFont());
textArea.setMinHeight(0);
textArea.setWrapText(true);
textArea.focusedProperty().addListener((val, before, after) -> {
if (!after) { // if we lost focus
rebuildFeatureIfTextChanged();
}
});
this.step = step;
initTextArea();
runButton.setOnAction(e -> run());
getChildren().addAll(textArea, runButton);
setLeftAnchor(textArea, 0.0);
setRightAnchor(textArea, 30.0);
setBottomAnchor(textArea, 0.0);
setRightAnchor(runButton, 0.0);
setTopAnchor(runButton, 2.0);
setBottomAnchor(runButton, 0.0);
}
示例2: LogPanel
import javafx.scene.control.TextArea; //导入方法依赖的package包/类
public LogPanel() {
setPadding(new Insets(2.0));
VBox content = new VBox(2.0);
setCenter(content);
textArea = new TextArea();
textArea.setFont(App.getDefaultFont());
Button clearButton = new Button("Clear Log");
clearButton.setOnAction(e -> textArea.clear());
appender = new TextAreaLogAppender(textArea);
content.getChildren().addAll(textArea, clearButton);
}
示例3: HeaderPanel
import javafx.scene.control.TextArea; //导入方法依赖的package包/类
public HeaderPanel(AppSession session) {
this.session = session;
content = new HBox(5);
content.setPadding(new Insets(5));
setCenter(content);
textContent = new TextArea();
textContent.setPrefRowCount(16);
textContent.setVisible(false);
setBottom(textContent);
textContent.setManaged(false);
textContent.setFont(App.getDefaultFont());
textContent.focusedProperty().addListener((val, before, after) -> {
if (!after) { // if we lost focus
rebuildFeatureIfTextChanged();
}
});
MenuBar menuBar = new MenuBar();
Menu fileMenu = new Menu("File");
openFileMenuItem = new MenuItem("Open");
fileMenu.getItems().addAll(openFileMenuItem);
Menu importMenu = new Menu("Import");
openImportMenuItem = new MenuItem("Open");
importMenu.getItems().addAll(openImportMenuItem);
menuBar.getMenus().addAll(fileMenu, importMenu);
setTop(menuBar);
if (session != null) {
Label envLabel = new Label("karate.env");
envLabel.setPadding(new Insets(5, 0, 0, 0));
TextField envTextField = new TextField();
envTextField.setText(session.getEnv().env);
Button envButton = new Button("Reset");
envButton.setOnAction(e -> session.resetAll(envTextField.getText()));
Button runAllButton = new Button("Run ►►");
runAllButton.setOnAction(e -> session.runAll());
Button showContentButton = new Button(getContentButtonText(false));
initTextContent();
showContentButton.setOnAction(e -> {
boolean visible = !textContent.isVisible();
textContent.setVisible(visible);
textContent.setManaged(visible);
showContentButton.setText(getContentButtonText(visible));
});
content.getChildren().addAll(envLabel, envTextField, envButton, runAllButton, showContentButton);
}
}