1

Possible Duplicate:
Highlighting strings in JavaFX TextArea

TextArea text = new TextArea();
text.setText("select from");

now i want to set the different colors for those two words in the text area how to do that can any one help me?

Community
  • 1
  • 1
duke
  • 103
  • 6
  • 15

1 Answers1

3

Rich Text Support in controls will be provided by JavaFX8 - http://javafx-jira.kenai.com/browse/RT-23077. Here is the CSS properties that are available for TextInputControl-http://docs.oracle.com/javafx/2/api/javafx/scene/doc-files/cssref.html#textinputcontrol

The possible workarounds are:-

  1. Use a Rich Text Editor - http://docs.oracle.com/javafx/2/ui_controls/editor.htm
  2. Put the text with different formatting in a HBox.
  3. Draw them separately on the canvas.
Avik
  • 1,170
  • 10
  • 25