This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
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 Android Security Essentials Live Lessons this week in the Android 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: 24183
    
  34

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
 
 
subject: Clipboard .isDataFlavorAvailable() In Java 1.4
 
Similar Threads
Vote here: I'm studying for the SCJP 1.5 exam
New in JavaRanch and need helps and guidance
Guidance for "intermittent" Java developers?
how to pass the SCJP as an experienced programmer
tomcat can't run in windows 2000 professional