I have a problem with a Vector of BufferedImage objects. I'm trying to add BufferedImage objects into the Vector but the Vector is always empty. The ImageIo.read(input1) seems not working but I don't understand why.
Here's a part of my code :
private void drawPixel(int index,String name) throws IOException {
File input1 = new File("pince.png");
BufferedImage img = ImageIO.read(input1);
Graphics g = this.imagePoints.getGraphics();
imagePixelLabelBuffered.add(img);
input1.delete();
changeColorPixelLabel(imagePixelLabelBuffered.get(labelClassesCount-1),labelClassesCount-1);
File output = new File("pince.png");
//ImageIO.write(imagePixelLabelBuffered.get(labelClassesCount-1), "PNG", output);
int x = (index % this.width);
int y = (index / this.width);
g.drawImage(imagePixelLabelBuffered.get(labelClassesCount-1),x-20, y-31,100,100, null);
repaint();
}