Here is the function that i want to use in a web page and want to call it in script node as other javascript functions. But could you please guide me on how to achieve it.
public static String getClipboard() {
Transferable t = Toolkit.getDefaultToolkit().getSystemClipboard().getContents(null);
try {
if (t != null && t.isDataFlavorSupported(DataFlavor.stringFlavor)) {
String text = (String)t.getTransferData(DataFlavor.stringFlavor);
return text;
}
} catch (UnsupportedFlavorException e) {
} catch (IOException e) {
}
return null;
}
I am completely new to this concept.. If you can answer this question, that will be very helpful.. Thanks
Use LiveConnect to enable bidirectional communication between Java and JavaScript within a page.
You can only call interact with Java if it's running on a Java Applet.
If you need to interact with the clipboard in Javascript, this Stack Overflow question answers that for you.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With