JavaFX HTML Editor


JavaFX HTML Editor Tutorials:

The JavaFX HTML Editor is a full functional rich text editor.

We can say it is a application which we including in our JavaFX application.

Features of html editor:

  • Copying and pasting
  • Text formatting
  • Text alignment
  • Paragraph settings such as format, font family, and font size
  • Numbered lists
  • Foreground and background colors
  • Adding a horizontal rule etc.

Constructors :


Creates a new instance of the HTMLEditor control.

Creating HTMLEditor :

To create new HTMLEditor

HTMLEditor htmleditor = new HTMLEditor();

We use the setHtmlText(String htmlText) method

To sets the HTML content of the editor.

For example

" different GUI in java "+

    • JavaFX
    • JavaSwing
    • AWT


IT look like

Example of html editor:

package javafxtuts;
import javafx.application.Application;
import javafx.geometry.Insets;
import javafx.scene.Scene;
import javafx.scene.layout.VBox;
import javafx.scene.web.HTMLEditor;
import javafx.stage.Stage;

public class Javafxtuts extends Application {

  public static void main(String[] args) {

  public void start(Stage stage) {
	//creating HTMLEditor 
      HTMLEditor htmlEditor = new HTMLEditor();
      VBox root =new VBox();
      root.setPadding(new Insets(20, 10, 10, 10));
        Scene scene = new Scene(root, 250, 200);

Output :


Leave A Reply