I have the following code:
public static void main(String[] args) {
JFrame frm = new JFrame();
JEditorPane pane = new JEditorPane(\"text/html\", \"&l
you can NOT display an BufferedImage within an HTML-Tag!
you can create an BufferedImage without saving it, you can create a BufferedImage from an URI/URL and you can display HTML within most swing components, but you can't do both in one;
maybe you can customize your swing component by overriding the paintComponent method and paint html and then image (maybe you want to to it the other way round).
private BufferedImage buffImg; //won't be stored
private void readImage(){
URL url = URI.create("myUri").toURL();
buffImg = ImageIO.read(url);
}
@Override
public void paintComponent (Graphics gr){
super(gr); //draws your html code
gr.drawImage(buffImg, x, y, obs); //draweing the buffImage
}