### Copy & paste using the Clipboard

Clipboard Copy and Paste can be done by using the type Clipboard from the jFX library.
`Sub Process_Globals
Private fx As JFX
...
End Sub`
' Copy String to the Clipboard
' Parameter s: String to copy
`Sub copyStringToClipboard(s As String)
fx.Clipboard.SetString(s)
End Sub`
' Paste String from Clipboard
' Return: String
`Sub pasteStringFromClipboard As String
Return fx.Clipboard.GetString
End Sub`
This is another possibility to use the clipboard via JavaObject, but NOT the preferred way.
The TextArea control is wrapped to a JavaObject for which the API methods Copy & Paste are executed.
See http://docs.oracle.com/javafx/2/api/javafx/scene/control/TextInputControl.html
' CopyStringToClipboard via JavaObject
' Parameter: String
`Sub CopyStringToClipboard(s As String)
Dim ta As TextArea
ta.Initialize("ta")
ta.Text = s
ta.SelectAll
Dim jo As JavaObject = ta
jo.RunMethod("copy", Null)
End Sub`
' PasteStringFromClipboard via JavaObject
' Return: String
`Sub PasteStringFromClipboard As String
Dim ta As TextArea
ta.Initialize("ta")
Dim jo As JavaObject = ta
jo.RunMethod("paste", Null)
ta.SelectAll
Return ta.Text
End Sub`

Changed: , Category: Clipboard, File: T6C172M1250.htm, ID: 1250