2

I have a JTextPane and I do it :

HTMLEditorKit kit = new HTMLEditorKit();
HTMLDocument doc = new HTMLDocument();`

this.setEditorKit(kit);
this.setDocument(doc);

Then I do :

profilePictureSrc = "http://ola/profilePicture1.jpg";
chatContent ="<img src=\"" + profilePictureSrc + "\">";

Where profilePictureSrc is a URL Object.

It works but I must use a String instead of the URL (Java Hashtable put method slow down my application)

How Can I do that ? Do I have to put the picture files somewhere and use a relative Path to reach them ? Thank you very much for your ideas

Best Regards

Community
  • 1
  • 1
Vincent Roye
  • 2,751
  • 7
  • 33
  • 53

1 Answers1

0

You can convert url objects to strings.

String urlstring = myurl.toString();

Sri Harsha Chilakapati
  • 11,744
  • 6
  • 50
  • 91