Imagine you have a button whose listener is something like this:
Transferable trans = Toolkit.getDefaultToolkit().getSystemClipboard().getContents();
Clipboard.setContents(trans, Toolkit.getDefaultToolkit().getSystemClipboard().owner);
You copy some stuff (like a .ct
file, or a bit of text with an image
in the middle; I'm going for more than a .txt
file or just a string
) and then press that button (executing the code above), will something I had copied change?
The direction of my question is, how much of my original information will be kept or lost when it's transformed into a Transferable
? If I copy a couple of different things (say an image, some text and somehow a file too), will I be able to access them all individually? What happens if I transfer a piece of data that has no matching DataFlavor
?