當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。