Reputation: 371
i have to display image stored in my database, or e.g. created in program memory, in JEditorPane
. Is there any way to do it? Thanks for reply.
I forgot tell that my JEditorPane is a WYSIWYG html editor. Html editor mean that, i can edit text like in OpenOffice, but this is still desctop application.
Upvotes: 0
Views: 640
Reputation: 28588
Assuming that the image is stored in a BLOB, get an input stream from the blob and pass it to
BufferedImage image = ImageIO.read(InputStream is);
Then have your pane's
paintComponent(Graphics g)
do among other things
g.drawImage(image, transform, observer);
Upvotes: 1