Search in sources :

Example 6 with Clipboard

use of javafx.scene.input.Clipboard in project bitsquare by bitsquare.

the class Utilities method copyToClipboard.

public static void copyToClipboard(String content) {
    try {
        if (content != null && content.length() > 0) {
            Clipboard clipboard = Clipboard.getSystemClipboard();
            ClipboardContent clipboardContent = new ClipboardContent();
            clipboardContent.putString(content);
            clipboard.setContent(clipboardContent);
        }
    } catch (Throwable e) {
        log.error("copyToClipboard failed " + e.getMessage());
        e.printStackTrace();
    }
}
Also used : ClipboardContent(javafx.scene.input.ClipboardContent) Clipboard(javafx.scene.input.Clipboard)

Example 7 with Clipboard

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

the class LogsView method copyToClipboard.

/**
     * Copy logs to clipboard
     */
public void copyToClipboard() {
    final Clipboard clipboard = Clipboard.getSystemClipboard();
    final ClipboardContent content = new ClipboardContent();
    content.putString(sb.toString());
    clipboard.setContent(content);
}
Also used : ClipboardContent(javafx.scene.input.ClipboardContent) Clipboard(javafx.scene.input.Clipboard)

Aggregations

Clipboard (javafx.scene.input.Clipboard)7 ClipboardContent (javafx.scene.input.ClipboardContent)5 FXML (javafx.fxml.FXML)2 Field (java.lang.reflect.Field)1 HashMap (java.util.HashMap)1 TableColumn (javafx.scene.control.TableColumn)1 DataFormat (javafx.scene.input.DataFormat)1 FontAwesomeLabel (jgnash.resource.font.FontAwesomeLabel)1 InjectFXML (jgnash.uifx.util.InjectFXML)1