当前位置: 首页>>代码示例>>Java>>正文


Java TextArea.setMaxHeight方法代码示例

本文整理汇总了Java中javafx.scene.control.TextArea.setMaxHeight方法的典型用法代码示例。如果您正苦于以下问题:Java TextArea.setMaxHeight方法的具体用法?Java TextArea.setMaxHeight怎么用?Java TextArea.setMaxHeight使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javafx.scene.control.TextArea的用法示例。


在下文中一共展示了TextArea.setMaxHeight方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createExpandableContent

import javafx.scene.control.TextArea; //导入方法依赖的package包/类
private static GridPane createExpandableContent(String content) {
	Label label = new Label("Exception stacktrace");

	TextArea textArea = new TextArea(content);
	textArea.setEditable(false);
	textArea.setWrapText(true);

	textArea.setMaxWidth(Double.MAX_VALUE);
	textArea.setMaxHeight(Double.MAX_VALUE);
	GridPane.setVgrow(textArea, Priority.ALWAYS);
	GridPane.setHgrow(textArea, Priority.ALWAYS);

	GridPane expContent = new GridPane();
	expContent.setMaxWidth(Double.MAX_VALUE);
	expContent.add(label, 0, 0);
	expContent.add(textArea, 0, 1);

	return expContent;
}
 
开发者ID:vibridi,项目名称:fxutils,代码行数:20,代码来源:FXDialog.java

示例2: makeErrorGUI

import javafx.scene.control.TextArea; //导入方法依赖的package包/类
/**
    * Make a Error Dialog
    * @return BorderPane
    */
   public void makeErrorGUI() {
       root = new Group();
       Scene scene = new Scene(root, 360, 185, Color.WHITE);
       ImagePattern pattern = new ImagePattern(new Image("icon/bk2.jpg"));
       scene.setFill(pattern);
       setTitle("Error");
       setScene(scene);
       Image appIcon = new Image("icon/ERROR.png");
       getIcons().add(appIcon);
       BorderPane bp = new BorderPane();

       textArea = new TextArea(message);
       textArea.setEditable(false);
       textArea.setWrapText(true);
       textArea.setMaxWidth(320);
       textArea.setMaxHeight(130);
       HBox hBox = new HBox();
       hBox.setSpacing(5);
       hBox.setPadding(new Insets(5,0,0,0));
       hBox.setAlignment(Pos.BOTTOM_RIGHT);
       hBox.getChildren().addAll(openLogButton,okButton);
       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);
   }
 
开发者ID:ztan5,项目名称:TechnicalAnalysisTool,代码行数:33,代码来源:TatMessageBox.java

示例3: makeInfoGUI

import javafx.scene.control.TextArea; //导入方法依赖的package包/类
/**
    * Make Information Dialog
    * @return BorderPane
    */
   public void makeInfoGUI() {
       root = new Group();
       Scene scene = new Scene(root, 360, 185, Color.WHITE);
       ImagePattern pattern = new ImagePattern(new Image("icon/bk2.jpg"));
       scene.setFill(pattern);
       setTitle("Information");
       setScene(scene);
       Image appIcon = new Image("icon/INFO.png");
       getIcons().add(appIcon);
       BorderPane bp = new BorderPane();

       textArea = new TextArea(message);
       textArea.setEditable(false);
       textArea.setWrapText(true);
       textArea.setMaxWidth(320);
       textArea.setMaxHeight(130);
       HBox hBox = new HBox();
       hBox.setSpacing(5);
       hBox.setPadding(new Insets(5,0,0,0));
       hBox.setAlignment(Pos.BOTTOM_RIGHT);
       hBox.getChildren().addAll(okButton);
       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);
   }
 
开发者ID:ztan5,项目名称:TechnicalAnalysisTool,代码行数:33,代码来源:TatMessageBox.java

示例4: showThrowable

import javafx.scene.control.TextArea; //导入方法依赖的package包/类
/** Show error dialog. **/
static void showThrowable(Window parent, Throwable e) {
	Main.log(e);
	Alert alert = new Alert(Alert.AlertType.ERROR);
	alert.setTitle("Exception");
	alert.initOwner(parent);
	alert.initModality(Modality.WINDOW_MODAL);
	alert.setHeaderText(e.getClass().getName());
	alert.setContentText(e.getMessage());
	StringWriter stringWriter = new StringWriter();
	PrintWriter printWriter = new PrintWriter(stringWriter);
	e.printStackTrace(printWriter);
	String exceptionText = stringWriter.toString();
	TextArea textArea = new TextArea(exceptionText);
	textArea.setEditable(false);
	textArea.setWrapText(true);
	textArea.setMaxWidth(Double.MAX_VALUE);
	textArea.setMaxHeight(Double.MAX_VALUE);
	alert.getDialogPane().setExpandableContent(textArea);
	alert.showAndWait();
}
 
开发者ID:DeskChan,项目名称:DeskChan,代码行数:22,代码来源:App.java

示例5: createExceptionTextArea

import javafx.scene.control.TextArea; //导入方法依赖的package包/类
protected static GridPane createExceptionTextArea(Throwable errorToDisplay) {
    StringWriter sw = new StringWriter();
    PrintWriter pw = new PrintWriter(sw);
    errorToDisplay.printStackTrace(pw);
    String exceptionText = sw.toString();

    Label label = new Label("The exception stacktrace was:");

    TextArea textArea = new TextArea(exceptionText);
    textArea.setEditable(false);
    textArea.setWrapText(true);

    textArea.setMaxWidth(Double.MAX_VALUE);
    textArea.setMaxHeight(Double.MAX_VALUE);
    GridPane.setVgrow(textArea, Priority.ALWAYS);
    GridPane.setHgrow(textArea, Priority.ALWAYS);

    GridPane expContent = new GridPane();
    expContent.setMaxWidth(Double.MAX_VALUE);
    expContent.add(label, 0, 0);
    expContent.add(textArea, 0, 1);
    return expContent;
}
 
开发者ID:ciphertechsolutions,项目名称:IO,代码行数:24,代码来源:BaseController.java

示例6: initUI

import javafx.scene.control.TextArea; //导入方法依赖的package包/类
@PostConstruct
  void initUI(BorderPane pane) {
  	try {
	Button EnterButton = new Button();
	TextArea textbox = new TextArea();
	EnterButton.setText("Send Data");

	EnterButton.setOnAction((event) -> {
		String tmp = textbox.getText();
		Helper.handleButton(tmp);
	});

	textbox.setMaxWidth(500);
	textbox.setMaxHeight(100);
	textbox.setWrapText(true);
	textbox.setText("Type your sentence here");
	pane.setLeft(EnterButton);
	pane.setCenter(textbox);
}
      catch (Exception e)
      {
          e.printStackTrace();
      }
  }
 
开发者ID:agentlab,项目名称:SemanticRelationsEditor,代码行数:25,代码来源:InputPart.java

示例7: showNonblock

import javafx.scene.control.TextArea; //导入方法依赖的package包/类
/**
 * Shows the alert, but it isn't always on top
 */
public void showNonblock(){
    alert.initStyle(style);
    alert.setTitle("Exception Caught!");
    alert.setHeaderText("Exception encountered");
    alert.setContentText(error.getMessage());

    StringWriter sw = new StringWriter();
    PrintWriter pw = new PrintWriter(sw);
    error.printStackTrace(pw);
    String exceptionText = sw.toString();

    Label label = new Label("The exception stacktrace was:");
    TextArea textArea = new TextArea(exceptionText);
    textArea.setEditable(false);
    textArea.setWrapText(true);

    textArea.setMaxWidth(Double.MAX_VALUE);
    textArea.setMaxHeight(Double.MAX_VALUE);
    GridPane.setVgrow(textArea, Priority.ALWAYS);
    GridPane.setHgrow(textArea, Priority.ALWAYS);

    GridPane expContent = new GridPane();
    expContent.setMaxWidth(Double.MAX_VALUE);
    expContent.add(label, 0, 0);
    expContent.add(textArea, 0, 1);

    // Set expandable Exception into the dialog pane.
    alert.getDialogPane().setExpandableContent(expContent);

    alert.show();
}
 
开发者ID:cbrnrd,项目名称:AlertFX,代码行数:35,代码来源:ErrorBox.java

示例8: createAlertDialog

import javafx.scene.control.TextArea; //导入方法依赖的package包/类
private void createAlertDialog(DialogObject dialog) {
    Alert alert = new Alert(dialog.getType());
    alert.setTitle(dialog.getTitle());
    alert.setHeaderText(dialog.getHeader());
    alert.setContentText(dialog.getContent());

    Optional<ButtonType> result = alert.showAndWait();
    if (result.get() == ButtonType.OK) {
        System.exit(0);
    } else {
        StringWriter sw = new StringWriter();
        PrintWriter pw = new PrintWriter(sw);
        dialog.getexception().printStackTrace(pw);
        String exceptionText = sw.toString();

        Label label = new Label("The exception stacktrace was:");

        TextArea textArea = new TextArea(exceptionText);
        textArea.setEditable(false);
        textArea.setWrapText(true);

        textArea.setMaxWidth(Double.MAX_VALUE);
        textArea.setMaxHeight(Double.MAX_VALUE);
        GridPane.setVgrow(textArea, Priority.ALWAYS);
        GridPane.setHgrow(textArea, Priority.ALWAYS);

        GridPane expContent = new GridPane();
        expContent.setMaxWidth(Double.MAX_VALUE);
        expContent.add(label, 0, 0);
        expContent.add(textArea, 0, 1);

        alert.getDialogPane().setExpandableContent(expContent);

        alert.showAndWait();
    }
}
 
开发者ID:PanagiotisDrakatos,项目名称:Weather-Forecast,代码行数:37,代码来源:JFxBuilder.java

示例9: showDetailedErrorAlert

import javafx.scene.control.TextArea; //导入方法依赖的package包/类
public static void showDetailedErrorAlert(String title, String content, String detaildescription, String details) {
    Alert alert = new Alert(Alert.AlertType.ERROR);
    alert.setTitle(title);
    alert.setHeaderText(null);
    alert.setContentText(content);

    TextArea textArea = new TextArea(details);
    textArea.setEditable(false);
    textArea.setWrapText(true);

    Label label = new Label(detaildescription);

    textArea.setMaxWidth(Double.MAX_VALUE);
    textArea.setMaxHeight(Double.MAX_VALUE);
    GridPane.setVgrow(textArea, Priority.ALWAYS);
    GridPane.setHgrow(textArea, Priority.ALWAYS);

    GridPane expContent = new GridPane();
    expContent.setMaxWidth(Double.MAX_VALUE);
    expContent.add(label, 0, 0);
    expContent.add(textArea, 0, 1);

    // Set expandable Exception into the dialog pane.
    alert.getDialogPane().setExpandableContent(expContent);

    alert.showAndWait();
}
 
开发者ID:rumangerst,项目名称:CSLMusicModStationCreator,代码行数:28,代码来源:DialogHelper.java

示例10: createAlert

import javafx.scene.control.TextArea; //导入方法依赖的package包/类
/**
 * Create an alert with a given type, title, desciption, content text and expandable content.
 *
 * @param type The type of the alert
 * @param title The title of the alert
 * @param description The description in the alert
 * @param contentText The content text for the alert
 * @param expandableContent The expandable content in the alert. This parameter may be null
 * @return The created alert
 */
public static Alert createAlert(Alert.AlertType type, String title, String description,
    String contentText, String expandableContent) {
  Alert alert = new Alert(type);
  alert.setTitle(title);
  alert.setHeaderText(description);
  alert.setContentText(contentText);

  TextArea textArea = new TextArea(expandableContent);
  textArea.setEditable(false);
  textArea.setWrapText(true);

  textArea.setMaxWidth(Double.MAX_VALUE);
  textArea.setMaxHeight(Double.MAX_VALUE);
  GridPane.setVgrow(textArea, Priority.ALWAYS);
  GridPane.setHgrow(textArea, Priority.ALWAYS);
  
  if (expandableContent != null && expandableContent.length() > 0) {
    GridPane expContent = new GridPane();
    expContent.setMaxWidth(Double.MAX_VALUE);
    if (type.equals(Alert.AlertType.ERROR)) {
      Label label = new Label("Stack trace:");
      expContent.add(label, 0, 0);
    }
    expContent.add(textArea, 0, 1);
    alert.getDialogPane().setExpandableContent(expContent);
  }

  if (type.equals(Alert.AlertType.ERROR) && expandableContent != null) {
    System.err.println(contentText);
    System.err.println(expandableContent);
  }

  alert.getDialogPane().setId("AlertDialogPane_" + type.toString());

  return alert;
}
 
开发者ID:VerifAPS,项目名称:stvs,代码行数:47,代码来源:AlertFactory.java

示例11: showException

import javafx.scene.control.TextArea; //导入方法依赖的package包/类
public static Alert showException(String message, Exception ex) {
	Alert alert = new Alert(AlertType.ERROR);
	
	alert.setTitle("Exception");
       alert.setHeaderText("Encountered an Exception");
       alert.setContentText(message);

       StringWriter sw = new StringWriter();
       PrintWriter pw = new PrintWriter(sw);
       ex.printStackTrace(pw);
       String exceptionText = sw.toString();

       Label label = new Label("The exception stacktrace was:");

       TextArea textArea = new TextArea(exceptionText);
       textArea.setEditable(false);
       textArea.setWrapText(true);

       textArea.setMaxWidth(Double.MAX_VALUE);
       textArea.setMaxHeight(Double.MAX_VALUE);
       GridPane.setVgrow(textArea, Priority.ALWAYS);
       GridPane.setHgrow(textArea, Priority.ALWAYS);

       GridPane expContent = new GridPane();
       expContent.setMaxWidth(Double.MAX_VALUE);
       expContent.add(label, 0, 0);
       expContent.add(textArea, 0, 1);

       alert.getDialogPane().setExpandableContent(expContent);        
       return alert;
}
 
开发者ID:nshusa,项目名称:osrs-data-converter,代码行数:32,代码来源:Dialogue.java

示例12: showExceptionDialog

import javafx.scene.control.TextArea; //导入方法依赖的package包/类
public static void showExceptionDialog (String title, String headerText, String content, Throwable e) {
    //Source: http://code.makery.ch/blog/javafx-dialogs-official/

    Alert alert = new Alert(Alert.AlertType.ERROR);
    alert.setTitle(title);
    alert.setHeaderText(headerText);
    alert.setContentText(content);

    // Create expandable Exception.
    StringWriter sw = new StringWriter();
    PrintWriter pw = new PrintWriter(sw);
    e.printStackTrace(pw);
    String exceptionText = sw.toString();

    Label label = new Label("The exception stacktrace was:");

    TextArea textArea = new TextArea(exceptionText);
    textArea.setEditable(false);
    textArea.setWrapText(true);

    textArea.setMaxWidth(Double.MAX_VALUE);
    textArea.setMaxHeight(Double.MAX_VALUE);
    GridPane.setVgrow(textArea, Priority.ALWAYS);
    GridPane.setHgrow(textArea, Priority.ALWAYS);

    GridPane expContent = new GridPane();
    expContent.setMaxWidth(Double.MAX_VALUE);
    expContent.add(label, 0, 0);
    expContent.add(textArea, 0, 1);

    //set expandable Exception into the dialog pane.
    alert.getDialogPane().setExpandableContent(expContent);

    alert.showAndWait();
}
 
开发者ID:open-erp-systems,项目名称:erp-frontend,代码行数:36,代码来源:JavaFXUtils.java

示例13: show

import javafx.scene.control.TextArea; //导入方法依赖的package包/类
/**
 * Shows the alert
 */
public void show(){
    alert.initStyle(style);
    alert.setTitle("Exception Caught!");
    alert.setHeaderText("Exception encountered");
    alert.setContentText(error.getMessage());

    StringWriter sw = new StringWriter();
    PrintWriter pw = new PrintWriter(sw);
    error.printStackTrace(pw);
    String exceptionText = sw.toString();

    Label label = new Label("The exception stacktrace was:");
    TextArea textArea = new TextArea(exceptionText);
    textArea.setEditable(false);
    textArea.setWrapText(true);

    textArea.setMaxWidth(Double.MAX_VALUE);
    textArea.setMaxHeight(Double.MAX_VALUE);
    GridPane.setVgrow(textArea, Priority.ALWAYS);
    GridPane.setHgrow(textArea, Priority.ALWAYS);

    GridPane expContent = new GridPane();
    expContent.setMaxWidth(Double.MAX_VALUE);
    expContent.add(label, 0, 0);
    expContent.add(textArea, 0, 1);

    // Set expandable Exception into the dialog pane.
    alert.getDialogPane().setExpandableContent(expContent);

    alert.showAndWait();

}
 
开发者ID:cbrnrd,项目名称:AlertFX,代码行数:36,代码来源:ErrorBox.java

示例14: makeWaningGUI

import javafx.scene.control.TextArea; //导入方法依赖的package包/类
/**
    * Make a Warning Dialog
    * @return BorderPane
    */
   public void makeWaningGUI() {
       root = new Group();
       Scene scene = new Scene(root, 360, 185, Color.WHITE);
       ImagePattern pattern = new ImagePattern(new Image("icon/bk2.jpg"));
       scene.setFill(pattern);
       setTitle("Warning");
       setScene(scene);
       Image appIcon = new Image("icon/ERROR.png");
       getIcons().add(appIcon);
       BorderPane bp = new BorderPane();

       textArea = new TextArea(message);
       textArea.setEditable(false);
       textArea.setWrapText(true);
       textArea.setMaxWidth(320);
       textArea.setMaxHeight(130);
       HBox hBox = new HBox();
       hBox.setSpacing(5);
       hBox.setPadding(new Insets(5,0,0,0));
       hBox.setAlignment(Pos.BOTTOM_RIGHT);
       hBox.getChildren().addAll(okButton);
       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);
   }
 
开发者ID:ztan5,项目名称:TechnicalAnalysisTool,代码行数:33,代码来源:TatMessageBox.java

示例15: displayExceptionAlert

import javafx.scene.control.TextArea; //导入方法依赖的package包/类
private void displayExceptionAlert(String header, Exception e) {
    if (mErrorAlert != null && mErrorAlert.isShowing()) {
        return;
    }
    mErrorAlert = new Alert(Alert.AlertType.ERROR);
    mErrorAlert.setResizable(true);
    mErrorAlert.setTitle("Error");
    if (header != null) {
        mErrorAlert.setHeaderText(header);
    }

    /*
     * After http://code.makery.ch/blog/javafx-dialogs-official
     */
    StringWriter sw = new StringWriter();
    PrintWriter pw = new PrintWriter(sw);
    e.printStackTrace(pw);
    String exceptionText = sw.toString();

    Label label = new Label("Stacktrace:");

    TextArea textArea = new TextArea(exceptionText);
    textArea.setEditable(false);
    textArea.setWrapText(true);

    textArea.setMaxWidth(Double.MAX_VALUE);
    textArea.setMaxHeight(Double.MAX_VALUE);
    GridPane.setVgrow(textArea, Priority.ALWAYS);
    GridPane.setHgrow(textArea, Priority.ALWAYS);

    GridPane expContent = new GridPane();
    expContent.setMaxWidth(Double.MAX_VALUE);
    expContent.add(label, 0, 0);
    expContent.add(textArea, 0, 1);

    mErrorAlert.getDialogPane().setExpandableContent(expContent);

    mErrorAlert.showAndWait();
}
 
开发者ID:nwg-piotr,项目名称:EistReturns,代码行数:40,代码来源:Utils.java


注:本文中的javafx.scene.control.TextArea.setMaxHeight方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。