简体   繁体   中英

JavaFX label text Underline Spacing with Css

I have Forget password label in JavaFX application that I applied underline on it. UI I know this isn't possible to do with a basic property, but instead I have applied the following CSS to the label and I don't know how to set Spacing between the text and the underline css

Specifying the underline offset

JavaFX css does not have a text-underline-offset attribute as far as I know. You could display the link in a WebView and configure the offset using web css rather than JavaFX css, but I wouldn't really recommend that.

JavaFX private implementation uses an underline offset , but that is not public API and cannot be controlled via public API, so I don't think that helps you.

Related info on clickable text (hyperlinks)

For clickable text, you should use a Hyperlink rather than a Label.

See the Hyperlink tutorial and css .

Hyperlink, by default only displays an underline on hover, to have it always displayed, see the related question:

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM