static void paintTiledBackground(Component c, Graphics g, BufferedImage image) { int width = c.getWidth(); int height = c.getHeight(); for (int x = 0; x < width; x += image.getWidth()) for (int y = 0; y < height; y += image.getHeight()) g.drawImage(image, x, y, c); }