This discussion is archived
11 Replies Latest reply: Jan 11, 2013 11:05 PM by James_D RSS

How to underline the text of a TextArea

twasyl Newbie
Currently Being Moderated
Hi everybody,

I've been trying to underline the text of a TextArea without success. I've tried different things like:
TextArea textArea = new TextArea();
textArea.setStyle("-fx-underline: true;");
or:
TextArea textArea = new TextArea();
textArea.lookup(".text-input").setStyle("-fx-underline: true;");
According the CSS reference guide (http://docs.oracle.com/javafx/2/api/javafx/scene/doc-files/cssref.html) the -fx-underline property is available for a Text and a Labeled, and TextArea is not one of them. And a TextArea is a TextInputControl, which supports some font properties but none of them is an underlying one.

Anybody has an idea? Or should I switch to a WebView?

Thanks.

PS: configuration: OS X 10.7 | 10.8 - JDK 7u10 - JavaFX 2.2.4

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points