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

The following examples show how to use javafx.scene.control.TextArea#setPrefSize() . 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: GUIUtil.java    From bisq with GNU Affero General Public License v3.0 7 votes vote down vote up
public static void showSelectableTextModal(String title, String text) {
    TextArea textArea = new BisqTextArea();
    textArea.setText(text);
    textArea.setEditable(false);
    textArea.setWrapText(true);
    textArea.setPrefSize(800, 600);

    Scene scene = new Scene(textArea);
    Stage stage = new Stage();
    if (null != title) {
        stage.setTitle(title);
    }
    stage.setScene(scene);
    stage.initModality(Modality.NONE);
    stage.initStyle(StageStyle.UTILITY);
    stage.show();
}
 
Example 2
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 3
Source File: ExceptionHandler.java    From arma-dialog-creator with MIT License 5 votes vote down vote up
/**
 Returns a TextArea with the Throwable's stack trace printed inside it

 @param thread thread where the Throwable occurred
 @param t throwable
 @return TextArea
 */
@NotNull
public static TextArea getExceptionTextArea(Thread thread, Throwable t) {
	String err = getExceptionString(t);
	TextArea ta = new TextArea();
	ta.setPrefSize(700, 700);
	ta.setText(err + "\nTHREAD:" + thread.getName());
	ta.setEditable(false);
	return ta;
}