Hi,
thanks a lot for the tip.
Now I can insert text with the Graphics2D object and save it with the ImageIO class
Graphics2D g2 = img.createGraphics();
g2.setColor(Color.black);
g2.setFont(font);
g2.drawString(text, 80,1440);
File outputfile = new File(f"imagewithtext.png");
ImageIO.write(img, "png", outputfile);