0

I get an Image as a Blob from a database and want to draw it into a JPanel. If i run the following code nothing is drawn but there isn't an error. Can anyone tell me what's wrong? I Never worked with images in java...

Blob image = rs.getBlob("com_img");
Graphics2D g2;
BufferedImage img;
try {
        img = ImageIO.read(image.getBinaryStream());
        g2 = (Graphics2D)ImageIO.read(image.getBinaryStream()).getGraphics();
        g2.drawImage(img,0,0, panel);
        panel.paint(g2);


    } catch (IOException e1) {
        // TODO Auto-generated catch block
        e1.printStackTrace();
    }
user2393256
  • 874
  • 13
  • 24

0 Answers0