• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to use java.awt.Image with HTML?

 
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 .
 
author & internet detective
Posts: 41860
908
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic