Here you go :
https://gist.github.com/JaDogg/8e83b8e641c84aad12ba
forked from jewelsea/HTMLEditorCustomizationSample.java
Here you go :
https://gist.github.com/JaDogg/8e83b8e641c84aad12ba
forked from jewelsea/HTMLEditorCustomizationSample.java
I read a lot of interesting articles here. Probably you spend
a lot of time writing.
thanks this has worked for me.
Also, if you want to append a local image, instead of setting source to image data, set it to an absolute URI. Assuming the image is referenced by a variable called “File imageFile”:
String img = “;
btn.setOnAction((ActionEvent event) -> {
htmlEditor.setHtmlText(htmlEditor.getHtmlText() +
img);
});
Sorry, the code didn’t look like I expected. So here it is:
String img =
btn.setOnAction((ActionEvent event) -> {
htmlEditor.setHtmlText(htmlEditor.getHtmlText() +
img);
});
just set the source to imageFile.toURI().toString()
Thanks, it worked. To set the image source to a file, set the “src” attribute of the image to files uri.
By calling toURI() on file object. And then call toString() to turn URI object to string. Set this to “src” attribute of img.