prokli Active Member Licensed User Longtime User Jul 13, 2014 #1 Hello! Does someone know, how to clear the clipboard in B4J? I use "fx.Clipboard.HasImage" within a timer function to check if there is an Image stored to clipboard. If so, I read the image to a variable, like this: "clipImage = fx.Clipboard.GetImage" Problem: after I have copied an Image to clipboard, the variable "fx.Clipboard.HasImage" remains TRUE. So how can I reset this variable or how can I clear the clipboard content??? Thx, Harald
Hello! Does someone know, how to clear the clipboard in B4J? I use "fx.Clipboard.HasImage" within a timer function to check if there is an Image stored to clipboard. If so, I read the image to a variable, like this: "clipImage = fx.Clipboard.GetImage" Problem: after I have copied an Image to clipboard, the variable "fx.Clipboard.HasImage" remains TRUE. So how can I reset this variable or how can I clear the clipboard content??? Thx, Harald
Daestrum Expert Licensed User Longtime User Jul 13, 2014 #2 A bit hackish but Code: Copy Dim myClipBoard As JavaObject myClipBoard.InitializeStatic("javafx.scene.input.Clipboard") myClipBoard.RunMethodJO("getSystemClipboard",Null).RunMethod("clear",Null) should work. Once defined you can just run the last line whenever you need it cleared. Last edited: Jul 13, 2014 Upvote 0
A bit hackish but Code: Copy Dim myClipBoard As JavaObject myClipBoard.InitializeStatic("javafx.scene.input.Clipboard") myClipBoard.RunMethodJO("getSystemClipboard",Null).RunMethod("clear",Null) should work. Once defined you can just run the last line whenever you need it cleared.
prokli Active Member Licensed User Longtime User Jul 14, 2014 #3 Works fine after downloading the Java Object library! Thanks a lot! Upvote 0