本文整理汇总了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;
}
示例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;
}
示例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);
}
示例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);
}
示例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();
}
示例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();
}
示例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);
}
示例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;
}
示例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);
}
示例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;
}
示例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();
}
示例12: createGraphicsNode
import javafx.scene.control.TextArea; //导入方法依赖的package包/类
@Override
@FXThread
protected @NotNull TextArea createGraphicsNode() {
final TextArea textArea = new TextArea();
textArea.setEditable(false);
return textArea;
}
示例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);
}
示例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();
}
示例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);
}