# Text fields: cut&pasting to and from

**URL:** <https://discourse.processing.org/t/text-fields-cut-pasting-to-and-from/16985>\
**Category:** Libraries\
**Created:** [January 9, 2020, 5:11pm UTC](https://discourse.processing.org/t/text-fields-cut-pasting-to-and-from/16985 "2020-01-09T17:11:45Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![obahama](https://avatars.discourse-cdn.com/v4/letter/o/bbe5ce/32.png) [@obahama](https://discourse.processing.org/u/obahama)\
**Post date:** [January 9, 2020, 5:11pm UTC](https://discourse.processing.org/t/text-fields-cut-pasting-to-and-from/16985/1 "2020-01-09T17:11:45Z")

</div>

I currently have code that reads a text file into an array, edits certain parts of the text, then writes the edits to a text file. Now I want to update this to a UI where I can paste the text into a text field, click a button to do the edits and have the edited text appear in a separate text field so I can select all and copy it. The output text will likely not all fit in the window, thus I need to be able to select all before copying it. Ultimately I want to export as app so a user can run it, a window appears that they can then C&P into and out of the window.

I’ve checked out ControlP5, and it looks good for the input part… not sure about the output.

Thanks,

Wade

---

<div class="post-metadata">

**Author:** ![kll](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kll/32/964_2.png) [@kll](https://discourse.processing.org/u/kll)\
**Post date:** [January 10, 2020, 1:15am UTC](https://discourse.processing.org/t/text-fields-cut-pasting-to-and-from/16985/2 "2020-01-10T01:15:57Z")

</div>

there is a newer / and maintained / library you might try:  
G4P  
see example  
G4P Text Area Control

---

<div class="post-metadata">

**Author:** ![obahama](https://avatars.discourse-cdn.com/v4/letter/o/bbe5ce/32.png) [@obahama](https://discourse.processing.org/u/obahama)\
**Post date:** [January 10, 2020, 3:10am UTC](https://discourse.processing.org/t/text-fields-cut-pasting-to-and-from/16985/3 "2020-01-10T03:10:23Z")

</div>

Thanks. I’ll dl and chk that out.

---

<div class="post-metadata">

**Author:** ![kfrajer](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kfrajer/32/196_2.png) [@kfrajer](https://discourse.processing.org/u/kfrajer)\
**Post date:** [January 10, 2020, 3:42am UTC](https://discourse.processing.org/t/text-fields-cut-pasting-to-and-from/16985/4 "2020-01-10T03:42:32Z")

</div>

Other suggestions from previous posts:

- [https://discourse.processing.org/t/answered-how-to-get-text-from-paste-buffer/1900%20%20%20](https://discourse.processing.org/t/answered-how-to-get-text-from-paste-buffer/1900%20%20%20)
- [https://forum.processing.org/two/discussion/27473/paste-and-copy-text%20%20](https://forum.processing.org/two/discussion/27473/paste-and-copy-text%20%20)
- [https://forum.processing.org/one/topic/copy-and-paste.html](https://forum.processing.org/one/topic/copy-and-paste.html)

Try them out and share solutions or issues that you find with any of this previous demos.

Kf

---

<div class="post-metadata">

**Author:** ![obahama](https://avatars.discourse-cdn.com/v4/letter/o/bbe5ce/32.png) [@obahama](https://discourse.processing.org/u/obahama)\
**Post date:** [January 10, 2020, 6:47pm UTC](https://discourse.processing.org/t/text-fields-cut-pasting-to-and-from/16985/5 "2020-01-10T18:47:20Z")

</div>

Thanks. I’ll check these out as well and will post final sol’n.
