File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Swing / AWT / SWT and the fly likes How to use java.awt.Image with HTML? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "How to use java.awt.Image with HTML?" Watch "How to use java.awt.Image with HTML?" New topic
Author

How to use java.awt.Image with HTML?

Baps Vakkalagadda
Ranch Hand

Joined: May 25, 2004
Posts: 47
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
internet detective
Marshal

Joined: May 26, 2003
Posts: 29220
    
135

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.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Baps Vakkalagadda
Ranch Hand

Joined: May 25, 2004
Posts: 47
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to use java.awt.Image with HTML?
 
Similar Threads
Any solutions to support MathML within JEditorPane
QTCanvas(Quicktime) & JPanel
MathML support in Java Swing application.
how to convert a Image to a RenderedImage
How to use java.awt.Image with HTML?