6

I'm using JavaFX integrated HTMLEditor. All the functions that it has are fine but I need to have also the function of inserting an image inside the HTML text. Do you know some source which I could use? Or some other HTML (WYSIWYG) editor that could be used inside JavaFX and it has this functionality ? I can program this functionality into the existing JavaFX HTMLEditor by myself, but I prefer to ask before I start doing something :)

Thank you very much for your answers ;)

Sergey Grinev
  • 34,078
  • 10
  • 128
  • 141
Reshi
  • 799
  • 4
  • 15
  • 32

1 Answers1

4

I'd advise just customizing the existing JavaFX HTMLEditor, if it does most things you need with the exception of adding images and the look and feel of it is basically ok for you.

I created a code sample to assist in some JavaFX HTMLEditor customization tasks.

Another option you could toy with for a very basic html editor is a WebView with contenteditable set to true. Though I haven't tried it with images - maybe it will work ok.

If the above options don't work for you there there are heaps of javascript based editors out there to choose from.

jewelsea
  • 150,031
  • 14
  • 366
  • 406
  • thank you very much for your answer:) i tried now to edit a little bit the html editor and it seems to work fine for me. For now it only inserts the image without making some special alingments on the image but ill upgrade it and post it somewhere on the net :) – Reshi Jun 14 '12 at 12:01
  • Hi Reshi did you ever get around to putting up your code for inserting images anywhere? I'm trying to figure out the same thing. – Julian Wright Dec 21 '12 at 02:13
  • Also HTMLEditor appears to use a WebView with contenteditable='true' internally anyway. What I can't figure out is how to find out where in the DOM the cursor is, or what the current selection is ( <- JavaFX Noob) – Julian Wright Dec 21 '12 at 02:15
  • @jewelsea but your code just override html previous contain. what if we just want to insert some html tag without loosing user context? – Sumeet Vishwas Aug 23 '17 at 10:58