本文整理汇总了Java中javafx.scene.control.TextArea.setPrefHeight方法的典型用法代码示例。如果您正苦于以下问题:Java TextArea.setPrefHeight方法的具体用法?Java TextArea.setPrefHeight怎么用?Java TextArea.setPrefHeight使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javafx.scene.control.TextArea
的用法示例。
在下文中一共展示了TextArea.setPrefHeight方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: start
import javafx.scene.control.TextArea; //导入方法依赖的package包/类
@Override
public void start(Stage primaryStage) throws Exception {
primaryStage.setTitle("Test the Scripting");
BorderPane root = new BorderPane();
TextArea input = new TextArea();
input.setPrefWidth(300);
input.setPrefHeight(300);
ScriptingExample scriptingExample = new ScriptingExample();
Button executeButton = new Button("Execute");
Button retrieveButton = new Button("Retrieve");
executeButton.setOnAction(e -> scriptingExample.inputScript(input.getText()));
retrieveButton.setOnAction(e ->scriptingExample.getTowersFromGroovy());
root.setCenter(input);
root.setBottom(executeButton);
root.setRight(retrieveButton);
primaryStage.setScene(new Scene(root));
primaryStage.show();
}
示例2: makeConfirmGUI
import javafx.scene.control.TextArea; //导入方法依赖的package包/类
/**
* Make Confirmation Dialog
* @return BorderPane
*/
public void makeConfirmGUI() {
root = new Group();
Scene scene = new Scene(root, 360, 185, Color.WHITE);
ImagePattern pattern = new ImagePattern(new Image("icon/bk2.jpg"));
scene.setFill(pattern);
setScene(scene);
setTitle("Confirmation");
Image appIcon = new Image("icon/CONFIRM.png");
getIcons().add(appIcon);
BorderPane bp = new BorderPane();
textArea = new TextArea(message);
textArea.setEditable(false);
textArea.setWrapText(true);
textArea.setPrefWidth(320);
textArea.setPrefHeight(130);
HBox hBox = new HBox();
hBox.setSpacing(5);
hBox.setPadding(new Insets(5,0,0,0));
hBox.setAlignment(Pos.BOTTOM_RIGHT);
hBox.getChildren().addAll(yesButton, noButton);
bp.setCenter(textArea);
bp.setBottom(hBox);
root.getChildren().add(bp);
sizeToScene();
setX(owner.getX() + Math.abs(owner.getWidth() - scene.getWidth()) / 2.0);
setY(owner.getY() + Math.abs(owner.getHeight() - scene.getHeight()) / 2.0);
}
示例3: SingleEventHandler
import javafx.scene.control.TextArea; //导入方法依赖的package包/类
private SingleEventHandler(BusEvent event, String currentScript) {
Label eventLabel = new Label(event.getClass().getSimpleName());
scriptField = new TextArea();
scriptField.setPrefHeight(SCRIPT_HEIGHT);
this.getChildren().addAll(eventLabel, scriptField, new MethodDisplay());
}