Important Notice - Forums is archived
To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

TUTORIALVaadin lets you build secure, UX-first PWAs entirely in Java.
Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.
Calling javascript synchronously by Enver Haase, 1 month ago
Upload Image From Clipboard
Hello. I want to add the functionality to upload an image from the clipboard. I have tried something like this:
Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard();
try {
BufferedImage image =
(BufferedImage)clipboard.getData(DataFlavor.imageFlavor);
}
catch(UnsupportedFlavorException ufe) {
ufe.printStackTrace();
}
catch(IOException ioe) {
ioe.printStackTrace();
}
However, this code only works in the local machine. I want to click a button and then, the clipboard's image will be uploaded to the server.
Thank you.
Last updated on
You cannot reply to this thread.