# Lightweight Text Selection

DevFeed: [Lightweight Text Selection](<https://devfeed.tech/articles/lightweight-text-selection-19351.md>)

Original publisher: [Read original article](<https://www.codenameone.com/blog/lightweight-text-selection/>)

Author: Shai Almog

Published: 2019-05-06T00:00:00Z

Content type: tutorial

Language: en

Sources: [CodeName One](<https://devfeed.tech/sources/codename-one.md>)

Topics: [ui](<https://devfeed.tech/topics/ui.md>), [web applications](<https://devfeed.tech/topics/web-applications.md>)

Tags: [components](<https://devfeed.tech/tags/components.md>), [copy](<https://devfeed.tech/tags/copy.md>), [keyboard](<https://devfeed.tech/tags/keyboard.md>), [native](<https://devfeed.tech/tags/native.md>), [ui](<https://devfeed.tech/tags/ui.md>), [web-app](<https://devfeed.tech/tags/web-app.md>)

## AI overview

This article explains lightweight text selection in Codename One. Native text editing already provides copy and paste, but the article describes a lightweight copy mechanism for selecting text in uneditable TextAreas and TextFields, with optional support for Labels and SpanLabels.

## Source excerpt

Text editing is implemented natively in Codename One. This provides a huge benefit as it allows us to ignore a lot of complex topics such as virtual keyboard localization etc. If we had to implement all that logic the overhead of Codename One would have been huge... One free benefit is seamless support for copy & paste. It "just works" thanks to the usage of the native widget we don't need to worry about that UI. However, this breaks down when we want to provide the ability to select & copy without the ability to edit. E.g. in a web app we can usually select any bit of text and copy it... That's convenient for some cases.