Search in sources :

Example 6 with TextArea

use of javafx.scene.control.TextArea in project bitsquare by bitsquare.

the class ShowWalletDataWindow method addContent.

private void addContent() {
    Tuple2<Label, TextArea> labelTextAreaTuple2 = addLabelTextArea(gridPane, ++rowIndex, "Wallet data:", "");
    TextArea textArea = labelTextAreaTuple2.second;
    Label label = labelTextAreaTuple2.first;
    label.setMinWidth(150);
    textArea.setPrefHeight(500);
    textArea.setStyle("-fx-font-size: 10;");
    CheckBox isUpdateCheckBox = addLabelCheckBox(gridPane, ++rowIndex, "Include private keys:", "").second;
    isUpdateCheckBox.setSelected(false);
    isUpdateCheckBox.selectedProperty().addListener((observable, oldValue, newValue) -> {
        textArea.setText(walletService.exportWalletData(isUpdateCheckBox.isSelected()));
    });
    textArea.setText(walletService.exportWalletData(isUpdateCheckBox.isSelected()));
    actionButtonText("Copy to clipboard");
    onAction(() -> Utilities.copyToClipboard(textArea.getText()));
}
Also used : TextArea(javafx.scene.control.TextArea) FormBuilder.addLabelTextArea(io.bitsquare.gui.util.FormBuilder.addLabelTextArea) FormBuilder.addLabelCheckBox(io.bitsquare.gui.util.FormBuilder.addLabelCheckBox) CheckBox(javafx.scene.control.CheckBox) Label(javafx.scene.control.Label)

Example 7 with TextArea

use of javafx.scene.control.TextArea in project bitsquare by bitsquare.

the class SendPrivateNotificationWindow method addContent.

private void addContent() {
    InputTextField keyInputTextField = addLabelInputTextField(gridPane, ++rowIndex, "Key for private notification:", 10).second;
    Tuple2<Label, TextArea> labelTextAreaTuple2 = addLabelTextArea(gridPane, ++rowIndex, "Private notification:", "Enter notification");
    TextArea alertMessageTextArea = labelTextAreaTuple2.second;
    Label first = labelTextAreaTuple2.first;
    first.setMinWidth(200);
    sendButton = new Button("Send private notification");
    sendButton.setOnAction(e -> {
        if (alertMessageTextArea.getText().length() > 0 && keyInputTextField.getText().length() > 0) {
            if (!sendPrivateNotificationHandler.handle(new PrivateNotification(alertMessageTextArea.getText()), pubKeyRing, nodeAddress, keyInputTextField.getText(), new SendMailboxMessageListener() {

                @Override
                public void onArrived() {
                    log.trace("PrivateNotificationMessage arrived at peer.");
                    new Popup<>().feedback("Message arrived.").onClose(SendPrivateNotificationWindow.this::hide).show();
                }

                @Override
                public void onStoredInMailbox() {
                    log.trace("PrivateNotificationMessage was stored in mailbox.");
                    new Popup<>().feedback("Message stored in mailbox.").onClose(SendPrivateNotificationWindow.this::hide).show();
                }

                @Override
                public void onFault(String errorMessage) {
                    new Popup<>().feedback("Message sending failed. error=" + errorMessage).onClose(SendPrivateNotificationWindow.this::hide).show();
                }
            }))
                new Popup().warning("The key you entered was not correct.").width(300).onClose(() -> blurAgain()).show();
        }
    });
    closeButton = new Button("Close");
    closeButton.setOnAction(e -> {
        hide();
        closeHandlerOptional.ifPresent(closeHandler -> closeHandler.run());
    });
    HBox hBox = new HBox();
    hBox.setSpacing(10);
    GridPane.setRowIndex(hBox, ++rowIndex);
    GridPane.setColumnIndex(hBox, 1);
    hBox.getChildren().addAll(sendButton, closeButton);
    gridPane.getChildren().add(hBox);
    GridPane.setMargin(hBox, new Insets(10, 0, 0, 0));
}
Also used : HBox(javafx.scene.layout.HBox) Insets(javafx.geometry.Insets) TextArea(javafx.scene.control.TextArea) FormBuilder.addLabelTextArea(io.bitsquare.gui.util.FormBuilder.addLabelTextArea) Button(javafx.scene.control.Button) FormBuilder.addLabelInputTextField(io.bitsquare.gui.util.FormBuilder.addLabelInputTextField) InputTextField(io.bitsquare.gui.components.InputTextField) Popup(io.bitsquare.gui.main.overlays.popups.Popup) Label(javafx.scene.control.Label) PrivateNotification(io.bitsquare.alert.PrivateNotification) SendMailboxMessageListener(io.bitsquare.p2p.messaging.SendMailboxMessageListener)

Example 8 with TextArea

use of javafx.scene.control.TextArea in project trex-stateless-gui by cisco-system-traffic-generator.

the class ConsoleLogView method buildUI.

private void buildUI() {
    logsContent = new TextArea();
    logsContent.setWrapText(true);
    logsContent.getStyleClass().add("consoleLogsContainer");
    setTopAnchor(logsContent, 0d);
    setLeftAnchor(logsContent, 0d);
    setBottomAnchor(logsContent, 0d);
    setRightAnchor(logsContent, 0d);
    getChildren().add(logsContent);
}
Also used : TextArea(javafx.scene.control.TextArea)

Example 9 with TextArea

use of javafx.scene.control.TextArea in project javaee7-samples by javaee-samples.

the class GoogleDocClient method start.

@Override
public void start(Stage stage) throws Exception {
    final Session session = connectToServer();
    System.out.println("Connected to server: " + session.getId());
    stage.setTitle("Google Docs Emulator using WebSocket");
    textarea = new TextArea();
    textarea.textProperty().addListener(new ChangeListener<String>() {

        @Override
        public void changed(ObservableValue<? extends String> observable, String oldValue, String newValue) {
            System.out.println("New value: " + newValue);
            try {
                session.getBasicRemote().sendText(newValue);
            } catch (IOException ex) {
                Logger.getLogger(GoogleDocClient.class.getName()).log(Level.SEVERE, null, ex);
            }
        }
    });
    textarea.setPrefSize(500, 300);
    textarea.setWrapText(true);
    Scene scene = new Scene(textarea);
    stage.setScene(scene);
    stage.show();
}
Also used : TextArea(javafx.scene.control.TextArea) IOException(java.io.IOException) Scene(javafx.scene.Scene) Session(javax.websocket.Session)

Example 10 with TextArea

use of javafx.scene.control.TextArea in project POL-POM-5 by PlayOnLinux.

the class StepRepresentationLicence method drawStepContent.

@Override
protected void drawStepContent() {
    super.drawStepContent();
    TextArea licenceWidget = new TextArea(licenceText);
    licenceWidget.setLayoutX(10);
    licenceWidget.setLayoutY(100);
    licenceWidget.setMinWidth(700);
    licenceWidget.setMaxWidth(700);
    licenceWidget.setMinHeight(308);
    licenceWidget.setMaxHeight(308);
    licenceWidget.setEditable(false);
    CheckBox confirmWidget = new CheckBox(tr("I agree"));
    confirmWidget.setOnAction(event -> {
        isAgree = !isAgree;
        confirmWidget.setSelected(isAgree);
        setNextButtonEnabled(isAgree);
    });
    confirmWidget.setLayoutX(10);
    confirmWidget.setLayoutY(418);
    setNextButtonEnabled(false);
    this.addToContentPane(licenceWidget);
    this.addToContentPane(confirmWidget);
}
Also used : TextArea(javafx.scene.control.TextArea) CheckBox(javafx.scene.control.CheckBox)

Aggregations

TextArea (javafx.scene.control.TextArea)21 Button (javafx.scene.control.Button)9 Scene (javafx.scene.Scene)7 Label (javafx.scene.control.Label)6 HBox (javafx.scene.layout.HBox)5 Popup (io.bitsquare.gui.main.overlays.popups.Popup)3 CheckBox (javafx.scene.control.CheckBox)3 BorderPane (javafx.scene.layout.BorderPane)3 Stage (javafx.stage.Stage)3 InputTextField (io.bitsquare.gui.components.InputTextField)2 FormBuilder.addLabelTextArea (io.bitsquare.gui.util.FormBuilder.addLabelTextArea)2 PaymentAccountContractData (io.bitsquare.payment.PaymentAccountContractData)2 Contract (io.bitsquare.trade.Contract)2 Offer (io.bitsquare.trade.offer.Offer)2 IOException (java.io.IOException)2 List (java.util.List)2 FXCollections (javafx.collections.FXCollections)2 ObservableList (javafx.collections.ObservableList)2 Insets (javafx.geometry.Insets)2 Node (javafx.scene.Node)2