How can I append text that was cut to the end of a textArea?
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Jill_Jones
Posted On:   Tuesday, April 9, 2002 12:35 AM


I created cut and append menu items. I successfully used cut() for the cutItem. The appendItem should add the text previously cut to the end of text in a textArea. Just like cut and paste, but cut and append instead. Using paste() is not sufficient.


I found a getContents() method which returns an object that represents the clipboard contents. I also found an append() method which takes a String. I tried to cast the object to a String, but I am a novice and cannot make it work. Is this the way to do it? If so, please show me an example. If not, how do I get this done? Thanks in advance : )

Re: How can I append text that was cut to the end of a textArea?

Posted By:   Paul_Connaughton  
Posted On:   Tuesday, April 9, 2002 01:07 AM

I assume that as this is the Swing Forum you are using JTextArea therefore the solution is already provided for you in the Swing API using Editor Kits.



Here is a short description of how to do it in the Java Tutorial.

About | Sitemap | Contact