Given some text with tags, for example:
He saw <person>Alice</person> in <location>London</location> the other day.
How could we apply style to specific tags in JavaFX. For example, we might want to have all person-tagged words to be blue or all location-tagged words to be bold.
More specifically consider the following code:
TextArea content = new TextArea();
content.setText("He saw <person>Alice</person> in ...");
which is displayed in the GUI. How could we change the style of the tagged words?
In the JavaFX stylesheet I've tried adding:
.text-area .content person{
-fx-color:blue;
}
But that doesn't work. Perhaps there is another way of approaching this entire problem?