TextArea is probably the right approach given the requirements (selection, 
avoiding ellipses).  It needs one improvement though which is “use content 
height” https://bugs.openjdk.org/browse/JDK-8310593 RFE to get rid of the 
scroll bars.

One can also try implementing a custom component modeled after TextArea/Label 
since the underlying Text class supports selection.

A different solution might involve adding a context menu with “Copy Text to 
Clipboard”, but that might not work if the requirement is to be able to select 
portions of the text.

I doubt this qualifies as a standard component though, but that’s just my 
opinion.

-andy


From: openjfx-dev <openjfx-dev-r...@openjdk.org> on behalf of Tobias Oelgarte 
<tobias.oelga...@gmail.com>
Date: Friday, August 16, 2024 at 08:18
To: openjfx-dev@openjdk.org <openjfx-dev@openjdk.org>
Subject: Re: Label Text Selection

I would also like to see this implemented, but as an additional 
"SelectableLabel" control, to avoid side effects (ellipsise, ...).

I also had to use the non editable TextField hack way to often.
On 16.08.24 12:29, Thiago Milczarek Sayão wrote:
Hi Dirk,

This would be great. It's a feature I miss.

On my scenario (we do a POS pharmacy software) users want to copy things such 
as product code/barcode, description, etc.

I think it's not a trivial task to develop this, since labels can wrap, 
ellipsise. They are inside tables and other components.

Some countries have user information protection laws, so it should not always 
be enabled.

-- Thiago



Em sex., 16 de ago. de 2024 07:13, Dirk Lemmermann 
<dlemmerm...@gmail.com<mailto:dlemmerm...@gmail.com>> escreveu:
Hi everyone,

I recently added a custom text control (called “TextView") to the GemsFX 
project. It supports a somewhat limited text selection. Selection is only 
possible on a per-word basis. I received a bit of feedback on this control and 
I was wondering whether it would be worth thinking about adding a general text 
selection capability to labels. Is this something worth looking into? Is it 
even feasible?

I guess one of the reasons why this topic keeps popping up is the fact that 
users are so used to selecting any text in web pages, but they can’t do it in 
desktop apps.

Dirk

Reply via email to