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


Java TextArea.setEditable方法代码示例

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


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

示例1: createTextArea

import javafx.scene.control.TextArea; //导入方法依赖的package包/类
private Node createTextArea(boolean selectable, boolean editable) {
    textArea = new TextArea();
    textArea.setPrefRowCount(4);
    textArea.setEditable(editable);
    textArea.textProperty().addListener((observable, oldValue, newValue) -> {
        text = textArea.getText();
    });
    textArea.setText(text);
    ScrollPane scrollPane = new ScrollPane(textArea);
    scrollPane.setFitToWidth(true);
    scrollPane.setFitToHeight(true);
    scrollPane.setHbarPolicy(ScrollBarPolicy.NEVER);
    scrollPane.setVbarPolicy(ScrollBarPolicy.ALWAYS);
    HBox.setHgrow(scrollPane, Priority.ALWAYS);
    return scrollPane;
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:17,代码来源:CheckList.java

示例2: 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

示例3: 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

示例4: 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

示例5: start

import javafx.scene.control.TextArea; //导入方法依赖的package包/类
public void start (Stage primaryStage) throws Exception{
	window = primaryStage;
	window.setTitle("Procurar Professor");
	pane = FXMLLoader.load(this.getClass().getResource("procurarProfessorFXML.fxml"));
	TextArea texto = (TextArea) pane.getChildren().get(4);
	texto.setEditable(false);
	window.setScene(new Scene(pane));
	window.setResizable(false);
	window.show();

}
 
开发者ID:omniplatypus,项目名称:Projeto-IP2,代码行数:12,代码来源:ProcurarProfessor.java

示例6: show

import javafx.scene.control.TextArea; //导入方法依赖的package包/类
void show() {
  textAreaLog = new TextArea();
  textAreaLog.setWrapText(true);
  textAreaLog.setEditable(false);
  textAreaLog.setPrefColumnCount(50);
  textAreaLog.setPrefRowCount(30);

  root = new FlowPane();
  root.setAlignment(Pos.BASELINE_CENTER);
  root.getChildren().add(textAreaLog);

  Stage stage = new Stage();
  stage.setScene(new Scene(root));
  stage.show();
}
 
开发者ID:RusZ,项目名称:TextClassifier,代码行数:16,代码来源:LogWindow.java

示例7: ExceptionAlert

import javafx.scene.control.TextArea; //导入方法依赖的package包/类
public ExceptionAlert(T throwable) {
    super(AlertType.ERROR);
    this.throwable = throwable;

    this.setTitle(throwable.getClass().getSimpleName());
    this.setHeaderText(throwable.getMessage());

    // Content Setter
    // REF http://code.makery.ch/blog/javafx-dialogs-official/
    Label label = new Label("Error details:");

    StringWriter sw = new StringWriter();
    PrintWriter pw = new PrintWriter(sw);
    throwable.printStackTrace(pw);
    this.stackTraceString = sw.toString();

    TextArea exceptionTextArea = new TextArea(this.stackTraceString);
    exceptionTextArea.setEditable(false);
    exceptionTextArea.setWrapText(true);

    exceptionTextArea.setPrefSize(this.getDialogPane().getWidth()-20, this.getDialogPane().getHeight());
    GridPane.setVgrow(exceptionTextArea, Priority.ALWAYS);
    GridPane.setHgrow(exceptionTextArea, Priority.ALWAYS);

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

    this.getDialogPane().setExpandableContent(expContent);
    this.getDialogPane().setMinHeight(300);
}
 
开发者ID:erayerdin,项目名称:primitivefxmvc,代码行数:33,代码来源:ExceptionAlert.java

示例8: exceptionAlert

import javafx.scene.control.TextArea; //导入方法依赖的package包/类
public static ViewerAlert exceptionAlert(Throwable ex) {
    ViewerAlert alert = new ViewerAlert(AlertType.ERROR);

    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.setFont(FontUtils.textFont);

    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:Glavo,项目名称:ClassViewer,代码行数:29,代码来源:ViewerAlert.java

示例9: ExceptionMessage

import javafx.scene.control.TextArea; //导入方法依赖的package包/类
public ExceptionMessage(String message, Exception ex) {
      super(AlertType.ERROR);
      setTitle("Exception");
      setHeaderText("Encountered an Exception");
      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);

      getDialogPane().setExpandableContent(expContent);
}
 
开发者ID:nshusa,项目名称:rsam-gui,代码行数:30,代码来源:Dialogue.java

示例10: createErrorAlert

import javafx.scene.control.TextArea; //导入方法依赖的package包/类
/**
 * Create a dialog for showing the exception.
 */
@FXThread
private static @NotNull Alert createErrorAlert(@NotNull final Exception e, @Nullable final String localizedMessage,
                                      @Nullable final String stackTrace) {

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

    VBox.setMargin(textArea, new Insets(2, 5, 2, 5));

    final Alert alert = new Alert(Alert.AlertType.ERROR);
    alert.setHeaderText(StringUtils.isEmpty(localizedMessage) ? e.getClass().getSimpleName() : localizedMessage);

    final DialogPane dialogPane = alert.getDialogPane();
    dialogPane.setExpandableContent(new VBox(textArea));
    dialogPane.expandedProperty().addListener((observable, oldValue, newValue) -> {

        if (newValue == Boolean.TRUE) {
            alert.setWidth(800);
            alert.setHeight(400);
        } else {
            alert.setWidth(500);
            alert.setHeight(220);
        }
    });

    return alert;
}
 
开发者ID:JavaSaBr,项目名称:jmonkeybuilder,代码行数:32,代码来源:EditorUtil.java

示例11: start

import javafx.scene.control.TextArea; //导入方法依赖的package包/类
public void start (Stage primaryStage) throws Exception{
	window = primaryStage;
	window.setTitle("Procurar Professor");
	pane = FXMLLoader.load(this.getClass().getResource("procurarDisciplinaFXML.fxml"));
	TextArea texto = (TextArea) pane.getChildren().get(4);
	menu2 = (MenuButton) pane.getChildren().get(9);
	um = (TextField) pane.getChildren().get(2);
	dois = (TextField) pane.getChildren().get(6);
	adiciona();
	texto.setEditable(false);
	window.setScene(new Scene(pane));
	window.setResizable(false);
	window.show();

}
 
开发者ID:omniplatypus,项目名称:Projeto-IP2,代码行数:16,代码来源:ProcurarDisciplina.java

示例12: createGraphicsNode

import javafx.scene.control.TextArea; //导入方法依赖的package包/类
@Override
@FXThread
protected @NotNull TextArea createGraphicsNode() {
    final TextArea textArea = new TextArea();
    textArea.setEditable(false);
    return textArea;
}
 
开发者ID:JavaSaBr,项目名称:jmonkeybuilder,代码行数:8,代码来源:TextFilePreview.java

示例13: createExtractedVarsTextArea

import javafx.scene.control.TextArea; //导入方法依赖的package包/类
private Pane createExtractedVarsTextArea(Code code) {
  final TextArea textArea = new TextArea();
  textArea.getStyleClass().addAll("model-text-area");
  textArea.setEditable(false);

  updateText(textArea, code);
  code.parsedCodeProperty().addListener((ob, old, parsedCode) ->
      updateText(textArea, code));

  return new StackPane(textArea);
}
 
开发者ID:VerifAPS,项目名称:stvs,代码行数:12,代码来源:EditorDemo.java

示例14: start

import javafx.scene.control.TextArea; //导入方法依赖的package包/类
public void start (Stage primaryStage) throws Exception{
	window = primaryStage;
	window.setTitle("Remover Disciplina");
	pane = FXMLLoader.load(this.getClass().getResource("removerDisciplinaFXML.fxml"));
	TextArea texto = (TextArea) pane.getChildren().get(4);
	menu2 = (MenuButton) pane.getChildren().get(9);
	nome = (TextField) pane.getChildren().get(2);
	id = (TextField) pane.getChildren().get(7);
	adiciona();
	texto.setEditable(false);
	window.setScene(new Scene(pane));
	window.setResizable(false);
	window.show();

}
 
开发者ID:omniplatypus,项目名称:Projeto-IP2,代码行数:16,代码来源:RemoverDisciplina.java

示例15: createExtractedTableTextArea

import javafx.scene.control.TextArea; //导入方法依赖的package包/类
private Pane createExtractedTableTextArea(ConstraintSpecification spec, ConstraintSpecificationValidator recognizer) {
  final TextArea textArea = new TextArea();
  textArea.getStyleClass().addAll("model-text-area");
  textArea.setEditable(false);

  updateText(textArea, spec);

  final Button updateButton = new Button("Refresh");
  updateButton.setOnAction(event -> updateText(textArea, spec));

  final TextArea problemsArea = new TextArea();
  problemsArea.getStyleClass().addAll("model-text-area");
  textArea.setEditable(false);

  updateProblemsText(problemsArea, recognizer);

  recognizer.problemsProperty().addListener((Observable o) -> updateProblemsText(problemsArea, recognizer));

  SplitPane splitPane = new SplitPane(textArea, problemsArea);
  splitPane.setOrientation(Orientation.VERTICAL);
  VBox.setVgrow(splitPane, Priority.ALWAYS);
  return new VBox(updateButton, splitPane);
}
 
开发者ID:VerifAPS,项目名称:stvs,代码行数:24,代码来源:SpecificationTableDemo.java


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