本文整理匯總了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);
}
}