convert bytes[] to image

How can i convert from bytes[] which is how my images are stored in my database to and image and display it on a JPanel?I tried paintIcon but i get a nullpointerexception.
[185 byte] By [skoloba] at [2007-11-26 22:55:31]
# 1

1. The most important thing is to determine the encoding being used,

because there are many ways to turn an image into an array of bytes.

2. Another crucial thing is making sure your code isn't corrupting the data:

do you have units tests that verify the byte[] going into the database

is the same data as the byte[] you select out of the database?

Answer those two points first.

DrLaszloJamfa at 2007-7-10 12:20:02 > top of Java-index,Security,Cryptography...
# 2
images class(es) take byte array in constructorconvert image (whatever format you end up with) to ImageIcon
SoulTech2012a at 2007-7-10 12:20:02 > top of Java-index,Security,Cryptography...