Java Code Examples for javafx.scene.control.TextArea#setMaxSize()

The following examples show how to use javafx.scene.control.TextArea#setMaxSize() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: DockItem.java    From phoebus with Eclipse Public License 1.0 6 votes vote down vote up
/** Show info dialog */
private void showInfo()
{
    final Alert dlg = new Alert(AlertType.INFORMATION);
    dlg.setTitle(Messages.DockInfo);

    // No DialogPane 'header', all info is in the 'content'
    dlg.setHeaderText("");

    final StringBuilder info = new StringBuilder();
    fillInformation(info);
    final TextArea content = new TextArea(info.toString());
    content.setEditable(false);
    content.setPrefSize(300, 100);
    content.setMaxSize(Double.MAX_VALUE, Double.MAX_VALUE);
    dlg.getDialogPane().setContent(content);

    DialogHelper.positionDialog(dlg, name_tab, 0, 0);
    dlg.setResizable(true);
    dlg.showAndWait();
}
 
Example 2
Source File: EditAreaView.java    From helloiot with GNU General Public License v3.0 6 votes vote down vote up
@Override
public Node constructContent() {
    
    StackPane stackpaneroot = new StackPane();
    stackpaneroot.setMaxSize(Double.MAX_VALUE, Double.MAX_VALUE);
    
    BorderPane borderpane = new BorderPane();
    
    statusview = new TextArea();
    statusview.setEditable(false);
    statusview.setFocusTraversable(false);
    statusview.setMaxSize(Double.MAX_VALUE, Double.MAX_VALUE);
    statusview.setPrefHeight(100.0);
    statusview.getStyleClass().add("unitinputview");
    BorderPane.setAlignment(statusview, Pos.CENTER);
    
    borderpane.setCenter(statusview);
    
    stackpaneroot.getChildren().add(borderpane);
    
    initialize();
    return stackpaneroot;
}
 
Example 3
Source File: EditAreaEvent.java    From helloiot with GNU General Public License v3.0 6 votes vote down vote up
@Override
public Node constructContent() {
    HBox hboxroot = new HBox();
    hboxroot.setSpacing(6.0);
    
    payload = new TextArea();
    payload.getStyleClass().add("unitinputarea");
    payload.setMaxSize(Double.MAX_VALUE, Double.MAX_VALUE);
    payload.setPrefHeight(100.0);
    HBox.setHgrow(payload, Priority.SOMETIMES);

    
    fireaction = new Button();
    fireaction.setFocusTraversable(false);
    fireaction.setMnemonicParsing(false);
    fireaction.getStyleClass().add("unitbutton");
    fireaction.setOnAction(this::onSendEvent);
    
    hboxroot.getChildren().addAll(payload, fireaction);
    
    initialize();
    return hboxroot;    
}
 
Example 4
Source File: LogView.java    From helloiot with GNU General Public License v3.0 6 votes vote down vote up
@Override
public Node constructContent() {
    StackPane stackpaneroot = new StackPane();
    stackpaneroot.setMaxSize(Double.MAX_VALUE, Double.MAX_VALUE);
    
    BorderPane borderpane = new BorderPane();
    
    statusview = new TextArea();
    statusview.setEditable(false);
    statusview.setFocusTraversable(false);
    statusview.setMaxSize(Double.MAX_VALUE, Double.MAX_VALUE);
    statusview.setPrefHeight(100.0);
    statusview.getStyleClass().addAll("unitinputview", "unitinputcode");
    BorderPane.setAlignment(statusview, Pos.CENTER);
    
    borderpane.setCenter(statusview);
    
    stackpaneroot.getChildren().add(borderpane);
    
    initialize();
    return stackpaneroot;
}
 
Example 5
Source File: TextAreaSample.java    From marathonv5 with Apache License 2.0 5 votes vote down vote up
public TextAreaSample() {
    TextArea textArea = new TextArea();
    textArea.setMaxSize(250, 250);
    VBox root = new VBox();
    root.getChildren().addAll(textArea, new Button("Click Me!!"));
    getChildren().add(root);
}
 
Example 6
Source File: ScrollBarPane.java    From JavaFX with MIT License 5 votes vote down vote up
@Override
public void start(Stage primaryStage) {
	AnchorPane pane = new AnchorPane();
	Scene frame = new Scene(pane, 300, 300);
	primaryStage.setScene(frame);

	TextArea ta = new TextArea("fdsgthtyjyt");
	ta.setMaxSize(150, 150);
	ta.setWrapText(true);
	pane.getChildren().addAll(ta);
	
	primaryStage.show();


}
 
Example 7
Source File: EditAreaStatus.java    From helloiot with GNU General Public License v3.0 4 votes vote down vote up
@Override
public Node constructContent() {
    StackPane stackpaneroot = new StackPane();
    
    boxview = new HBox();
    boxview.setSpacing(6.0);
    
    statusview = new TextArea();
    statusview.setEditable(false);
    statusview.setFocusTraversable(false);
    statusview.setMaxSize(Double.MAX_VALUE,Double.MAX_VALUE);
    statusview.setPrefHeight(100.0);
    statusview.getStyleClass().add("unitinputview");
    HBox.setHgrow(statusview, Priority.SOMETIMES);
    
    editaction = new Button();
    editaction.setFocusTraversable(false);
    editaction.setMnemonicParsing(false);
    editaction.getStyleClass().add("unitbutton");
    editaction.setOnAction(this::onEditEvent);
    
    boxview.getChildren().addAll(statusview, editaction);
    
    boxedit = new HBox();
    boxedit.setSpacing(6.0);
    boxedit.setVisible(false);
    
    statusedit = new TextArea();
    statusedit.setMaxSize(Double.MAX_VALUE,Double.MAX_VALUE);
    statusedit.setPrefHeight(100.0);        
    statusedit.getStyleClass().add("unitinputarea");
    HBox.setHgrow(statusedit, Priority.SOMETIMES);
    
    okaction = new Button();
    okaction.setFocusTraversable(false);
    okaction.setMnemonicParsing(false);
    okaction.getStyleClass().add("unitbutton");
    okaction.setOnAction(this::onOkEvent);
    
    cancelaction = new Button();
    cancelaction.setFocusTraversable(false);
    cancelaction.setMnemonicParsing(false);
    cancelaction.getStyleClass().add("unitbutton");
    cancelaction.setOnAction(this::onCancelEvent);
    
    boxedit.getChildren().addAll(statusedit, okaction, cancelaction);
    
    stackpaneroot.getChildren().addAll(boxview, boxedit);

    initialize();
    return stackpaneroot;
}