Check if a label is ellipsized and then add a tooltip

Davide Perini perini.davide at dpsoftware.org
Fri Feb 25 20:45:41 UTC 2022


It's a good workaround even if I would have preferred something built in 
into the framework... :)

Thank you Kevin!


Il 24/02/2022 01:21, Kevin Rushforth ha scritto:
> I don't know of a way to determine whether the text of a labeled is 
> currently being displayed truncated with ellipses. There isn't a 
> (read-only) overrun or displayedText property, either of which would 
> allow an app to know.
>
> The only thing I can think of to work around this is to estimate the 
> size that the text would need and compare it to the available size.
>
> -- Kevin
>
>
> On 2/23/2022 5:03 AM, Davide Perini wrote:
>> Hi,
>> I have a label inside a gridpane.
>>
>> It is possible to check if the label is ellipsized and if yes, add a 
>> tootltip to let the user read the entire label when overing the label 
>> with the mouse?
>>
>> Thanks
>> Davide
>



More information about the openjfx-dev mailing list