javafximportruntimeefxclipse

JavaFx: Editable styled text


I need a editable and styled TextArea. I search a lot and found some thrid party applications. But I cannot use external jars or libarys.

Then I found org.eclipse.fx.ui.controls.styledtext.StyledTextArea with is included in the e(fx)clipse plugin. This plugin is installed on my eclipse IDE, so I should be allowed to use this class.

My problem is, that I cannot import the class (although the plugin is properly installed and it's a JavaFX-Project).

Thanks for reading and help.


Solution

  • 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: