We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Why does not it run? sorry I cannot write English well.
import java.awt.datatransfer.*;
import java.awt.Toolkit;
void setup() {
setClipboardString("abc");//
println(getClipboardString());
}
Answers
What happens when you try to run this? Does it compile? Does it throw a runtime Exception? Something else?
Error・・・unexpected token:int
I'm really not sure what you're trying to do here. Please post the exact code- for example, the final keyword should not be capitalized. Your syntax is also off, as it's missing semicolons and I'm not sure why you're setting an int equal to a String. What exactly are you trying to do?
sorry. I do not understand about this web site. sorry
Maybe something like this?
Untested code!
I have deleted the other discussion about this topic because it had no useful information and it duplicated the question posted here.
I ran my code and apparently it says that the function setClipboardString does not exist. I tried declaring the clipboard class like:
But still no use. Are you sure of this function
setClipboardString()
? Where did you find the reference? Use Google Translate if you don't understand.The clipboard can be used for different data types, the solution below will copy and paste text only, but it is a starting point.
To use this code follow these 3 steps.
STEP 1 Create a second tab in the Processing IDE called
GClip.java
- the spelling, and upper/lower case must match exactlyGClip.java
STEP 2 Copy this code into the
GClip.java
tab file.STEP 3 Copy the following code into the main tab for your sketch. It is a very simple demo of how to use GClip to copy and paste text.