• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to use java.awt.Image with HTML?

 
Baps Vakkalagadda
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I am developing a java swing application in which i have a java.awt.Image object. This Image object is not taken from a file. It is generated some third party java classes.

My problem is how can I display this Image with dynamically generated HTML (using html tags like <IMG src="..."> in Swing components without writing my image to a file.

Can anyone help me? This is urgent.

Thanks (:confused .
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34974
379
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Baps,
You can't use HTML tags in Swing. You can draw the Image object to the Swing interface if you have it as an object.
 
Baps Vakkalagadda
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Jeanne,

Thank you for your reply.

I know that we can display HTML in Swing using JEditorPane. I have already developed a Swing application to display reports in HTML format. Now my problem is I have picture in java.awt.Image object. I do not know how to display it in JEditorPane with HTML <IMG> tag.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic