1

I have two applications:

1. My own Image Explorer. I want to operate with images via such options like copy-paste. I created own DataFlavor type for this. (Yeah, I really need that!) It is looks like

DataFlavor supportedFlavor = new DataFlavor(app.my.ImageWrapper.class, "ImageWrapper class");

And in my Transferable I use this DataFlavor:

            @Override
        public boolean isDataFlavorSupported(DataFlavor flavor) {
            return supportedFlavor.equals(flavor);
        }

        @Override
        public DataFlavor[] getTransferDataFlavors() {
            return new DataFlavor[]{supportedFlavor}; // Simpled for SSCCE, I don't create new flavor each time really
        }

2. FlavorListener from this answer. It should listen to FlavorEvents for detecting which data type is copied.

My problem is:

When I get the event from other application after copying the text, files, images, the DataFlavor is never null. But if I get the event after copying the my Object, it cannot detect any DataFlavor. WHY?

PS: Sorry for my bad English.

Community
  • 1
  • 1
SeniorJD
  • 6,946
  • 4
  • 36
  • 53
  • possible duplicate of [Java: use clipboard to copy-paste java objects between different instances of same application](http://stackoverflow.com/questions/14276182/java-use-clipboard-to-copy-paste-java-objects-between-different-instances-of-sa) – SeniorJD Jul 15 '13 at 16:13
  • Your English isn't that bad, I have seen much worse! – 06needhamt Jul 15 '13 at 16:34

1 Answers1

0

Thanks everyone, I've found the answer here after looking to the related section. This really wasn't show in search field, strange, because it is the second time similar situation...

Community
  • 1
  • 1
SeniorJD
  • 6,946
  • 4
  • 36
  • 53