Why do you need a StringSelection Object? You should just need the String, i.e. the one that is stored in your variable called 'selection'.
Btw, the error is that you're using PrintWriter's "print" method, and you are passing it a StringSelection Object. But if you look at the class documentation for PrintWriter, no such method exists. However, PrintWriter does have a method that takes a String, so you should get rid of the StringSelection variable and do:
pr.print(selection);
http://java.sun.com/j2se/1.4.2/docs/api/java/io/PrintWriter.html
^ Here is the PrintWriter javadoc, take a look. No "print" method exists that takes a StringSelection Object as a param.
BestJewSinceJC
Posting Maven
2,772 posts since Sep 2008
Reputation Points: 874
Solved Threads: 354