Java Code Examples for com.jfoenix.controls.JFXTextField#setTooltip()

The following examples show how to use com.jfoenix.controls.JFXTextField#setTooltip() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TxIdTextField.java    From bisq with GNU Affero General Public License v3.0 5 votes vote down vote up
public TxIdTextField() {
    txConfidenceIndicator = new TxConfidenceIndicator();
    txConfidenceIndicator.setFocusTraversable(false);
    txConfidenceIndicator.setMaxSize(20, 20);
    txConfidenceIndicator.setId("funds-confidence");
    txConfidenceIndicator.setLayoutY(1);
    txConfidenceIndicator.setProgress(0);
    txConfidenceIndicator.setVisible(false);
    AnchorPane.setRightAnchor(txConfidenceIndicator, 0.0);
    AnchorPane.setTopAnchor(txConfidenceIndicator, 3.0);
    progressIndicatorTooltip = new Tooltip("-");
    txConfidenceIndicator.setTooltip(progressIndicatorTooltip);

    copyIcon = new Label();
    copyIcon.setLayoutY(3);
    copyIcon.getStyleClass().addAll("icon", "highlight");
    copyIcon.setTooltip(new Tooltip(Res.get("txIdTextField.copyIcon.tooltip")));
    AwesomeDude.setIcon(copyIcon, AwesomeIcon.COPY);
    AnchorPane.setRightAnchor(copyIcon, 30.0);

    Tooltip tooltip = new Tooltip(Res.get("txIdTextField.blockExplorerIcon.tooltip"));

    blockExplorerIcon = new Label();
    blockExplorerIcon.getStyleClass().addAll("icon", "highlight");
    blockExplorerIcon.setTooltip(tooltip);
    AwesomeDude.setIcon(blockExplorerIcon, AwesomeIcon.EXTERNAL_LINK);
    blockExplorerIcon.setMinWidth(20);
    AnchorPane.setRightAnchor(blockExplorerIcon, 52.0);
    AnchorPane.setTopAnchor(blockExplorerIcon, 4.0);

    textField = new JFXTextField();
    textField.setId("address-text-field");
    textField.setEditable(false);
    textField.setTooltip(tooltip);
    AnchorPane.setRightAnchor(textField, 80.0);
    AnchorPane.setLeftAnchor(textField, 0.0);
    textField.focusTraversableProperty().set(focusTraversableProperty().get());
    getChildren().addAll(textField, copyIcon, blockExplorerIcon, txConfidenceIndicator);
}
 
Example 2
Source File: AddressTextField.java    From bisq with GNU Affero General Public License v3.0 4 votes vote down vote up
public AddressTextField(String label) {
    JFXTextField textField = new BisqTextField();
    textField.setId("address-text-field");
    textField.setEditable(false);
    textField.setLabelFloat(true);
    textField.setPromptText(label);

    textField.textProperty().bind(address);
    String tooltipText = Res.get("addressTextField.openWallet");
    textField.setTooltip(new Tooltip(tooltipText));

    textField.setOnMousePressed(event -> wasPrimaryButtonDown = event.isPrimaryButtonDown());
    textField.setOnMouseReleased(event -> {
        if (wasPrimaryButtonDown)
            GUIUtil.showFeeInfoBeforeExecute(AddressTextField.this::openWallet);

        wasPrimaryButtonDown = false;
    });

    textField.focusTraversableProperty().set(focusTraversableProperty().get());
    //TODO app wide focus
    //focusedProperty().addListener((ov, oldValue, newValue) -> textField.requestFocus());

    Label extWalletIcon = new Label();
    extWalletIcon.setLayoutY(3);
    extWalletIcon.getStyleClass().addAll("icon", "highlight");
    extWalletIcon.setTooltip(new Tooltip(tooltipText));
    AwesomeDude.setIcon(extWalletIcon, AwesomeIcon.SIGNIN);
    extWalletIcon.setOnMouseClicked(e -> GUIUtil.showFeeInfoBeforeExecute(this::openWallet));

    Label copyIcon = new Label();
    copyIcon.setLayoutY(3);
    copyIcon.getStyleClass().addAll("icon", "highlight");
    Tooltip.install(copyIcon, new Tooltip(Res.get("addressTextField.copyToClipboard")));
    AwesomeDude.setIcon(copyIcon, AwesomeIcon.COPY);
    copyIcon.setOnMouseClicked(e -> GUIUtil.showFeeInfoBeforeExecute(() -> {
        if (address.get() != null && address.get().length() > 0)
            Utilities.copyToClipboard(address.get());
    }));

    AnchorPane.setRightAnchor(copyIcon, 30.0);
    AnchorPane.setRightAnchor(extWalletIcon, 5.0);
    AnchorPane.setRightAnchor(textField, 55.0);
    AnchorPane.setLeftAnchor(textField, 0.0);

    getChildren().addAll(textField, copyIcon, extWalletIcon);
}