// actually do the drawing
g2.setColor(new Color(0, 0, 0));
g2.fillRect(0, 0, width, height);
g2.setColor(new Color(255, 255, 255));
// We position it to the center. Note that this is not the upper left corner
g2.drawString(text, (int) (requiredWidth / 2 - bounds.getWidth() / 2), (int) (requiredHeight / 2 + bounds.getHeight() / 4));
// Write the data, and send the modification data to let the client cache it
Bucket data = ctx.getBucketFactory().makeBucket(-1);
OutputStream os = data.getOutputStream();
try {