In order to enhance the readability of our text, it has been suggested that we outline the text of label controls. I know you can stroke Text shapes, but we went with Labels. I forget why, but I think it was because there was something a Label could do for us that a Text Shape could not.
How do I go about drawing an outline or a border around the letters and words of a label?
I tried -fx-stroke but that didn't work, and -fx-border just drew a border around the node. Is there anyway to make this work?
解决方案
Use CSS to specify the outline for your label text.
/** file: outline.css (place in same directory as OutlinedLabelText) */
.label {
-fx-font-size: 50px;
}
.outline.label .text {
-fx-fil