The closest in-built control for this without third party libraries would be HTMLEditor, which may or may not be appropriate for you.
You mention:
I cannot use external jars or libarys.
The org.eclipse.fx.ui.controls.styledtext.StyledTextArea
that you mention would still require a 3rd party library (IMO) as it does not ship with the JDK. Just because your Eclipse IDE is built using the eclipse controls, does not mean that your application will be able to use those controls without importing a 3rd party Eclipse library. Note, I have never used efxclipse and it might import some Eclipse libraries to make some Eclipse controls visible to JavaFX programs.
As most hits to this question will be by people who are OK with using an external library for text editing, options are:
- In-built TextArea which has no formatting capabilities.
- In-built HTMLEditor (based internally on in-built WebKit engine).
- A markdown style editor (like StackOverflow), just google "JavaFX Markdown".
- RichTextFX native JavaFX node based text editor.
- A 3rd party JavaScript based text editor embedded in a WebView. There are many of these, you would need to do your own research to see which, if any, is appropriate for your purposes.
- A 3rd party Swing or SWT based library embedded in JavaFX via a SwingNode, or FXCanvas. Note, if you are using SWT and Java 9+ you will need to import a
javafx.swt
module (I don't have instructions on how you might do that). There are a few Swing and SWT text editor libraries available, you would need to do your own research to see what would work best for you.