I
Ian Shef
Is there a way to be notified about all changes to the system clipboard?
How?
java.awt.datatransfer.Clipboard.addFlavorListener(FlavorListener listener)
only provides reliable notification (at least under Windows XP) if the
available DataFlavors have changed. I want to be notified if the clipboard
contents have been changed, even if the new contents have the same
DataFlavors as the previous contents.
I can force the issue by grabbing ownership of the clipboard via
clipboard.setContents(clipboard.getContents(null), this)
but this seems like an unfriendly act. Besides, if two such applications run
concurrently on the same host, they will grab control back and forth ad
nauseum.
I must be missing a better way.
How?
java.awt.datatransfer.Clipboard.addFlavorListener(FlavorListener listener)
only provides reliable notification (at least under Windows XP) if the
available DataFlavors have changed. I want to be notified if the clipboard
contents have been changed, even if the new contents have the same
DataFlavors as the previous contents.
I can force the issue by grabbing ownership of the clipboard via
clipboard.setContents(clipboard.getContents(null), this)
but this seems like an unfriendly act. Besides, if two such applications run
concurrently on the same host, they will grab control back and forth ad
nauseum.
I must be missing a better way.