import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.web.HTMLEditor;
import javafx.stage.Stage;

public class HTMLEditorTest extends Application
{
	public static void main(String[] args)
	{
		Application.launch(args);
	}

	private final String INITIAL_TEXT = "<!DOCTYPE html>\r\n" + 
			"<html>\r\n" + 
			"  <head>\r\n" + 
			"    <title>Display Image</title>\r\n" + 
			"  </head>\r\n" + 
			"  <body>\r\n" + 
			"    <div>\r\n" + 
			"    <p>Taken from wikpedia</p>\r\n" + 
			"    <img src=\"data:image/png;base64, iVBORw0KGgoAAAANSUhEUgAAAAUA\r\n" + 
			"AAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO\r\n" + 
			"    9TXL0Y4OHwAAAABJRU5ErkJggg==\" alt=\"Red dot\" />\r\n" + 
			"</div> \r\n" + 
			"  </body>\r\n" + 
			"</html>";

	@Override
	public void start(Stage stage)
	{
		// Create the HTMLEditor
		HTMLEditor htmlEditor = new HTMLEditor();
		// Set the Height of the HTMLEditor
		htmlEditor.setPrefHeight(300);
		// Set the Width of the HTMLEditor
		htmlEditor.setPrefWidth(600);
		htmlEditor.setHtmlText(INITIAL_TEXT);

		// Create the Scene
		Scene scene = new Scene(htmlEditor);
		// Add the Scene to the Stage
		stage.setScene(scene);
		// Set the Title of the Stage
		stage.setTitle("A simple HTMLEditor Example");
		// Display the Stage
		stage.show();
	}
}
