aspose file tools*
The moose likes Java in General and the fly likes Clipboard .isDataFlavorAvailable() In Java 1.4 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Clipboard .isDataFlavorAvailable() In Java 1.4" Watch "Clipboard .isDataFlavorAvailable() In Java 1.4" New topic
Author

Clipboard .isDataFlavorAvailable() In Java 1.4

Mark Newton
Ranch Hand

Joined: Jan 31, 2006
Posts: 129
Hi,

I'm being a bit lazy here, I could probably find a solution myself, but I'm on a bit of a deadline, and thought that someone might have been through this and found a solution that they'd be willing to share. Don't spend lots of time thinking about it though (unless you really want to! )

In a nutshell, I've been working on the assumption that I can use JVM version 1.5, but am now needing to go back to 1.4.2. I've made a very few changes, but need to find some equivalent for Clipboard.isDataFlavorAvailable(), which is only since Java 1.5. All the easy equivalents also seem to be since 1.5 - any help/pointers greatly appreciated!
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24166
    
  30

isDataFlavorAvailable() is a really very trivial convenience method. It just calls getContents() to get the Transferable, then calls isDataFlavorSupported() on the Transferable. Add a check for null here and there, and that's all she wrote.


[Jess in Action][AskingGoodQuestions]
Mark Newton
Ranch Hand

Joined: Jan 31, 2006
Posts: 129
Great - thanks very much, couldn't have asked for a more perfect answer! It's exactly what I was assuming would be the case, but I didn't have to think! Saved me a good 10 minutes... minus posting time, checking for replies, writing this response...

Still, it feels like I got something for nothing, and that's always good
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Clipboard .isDataFlavorAvailable() In Java 1.4
 
Similar Threads
Guidance for "intermittent" Java developers?
tomcat can't run in windows 2000 professional
how to pass the SCJP as an experienced programmer
New in JavaRanch and need helps and guidance
Vote here: I'm studying for the SCJP 1.5 exam