Reputation: 55
This is a feature that I have noticed in many web apps and I would like it to be in a TextArea on my JavaFX app.
The desktop version of Hemingway provides a good example:
Upvotes: 2
Views: 2493
Reputation: 159341
Set promptText on the TextArea.
textArea.setPromptText("Type or paste something to get started...");
If you want a more sophisticated solution that transfers the PromptText to a label above the TextField, so the prompt text is still visible when the user types, then the 3rd party Gluon glisten library does that, or MaterialFX has many text field prompt and label options. From your description, though you probably don't need the glisten functionality and the standard promptText
implementation in JavaFX TextAreas is probably fine for you.
Related:
Upvotes: 6