Java JPanel tiled background image
问题 I currently have the code for creating a JOptionPane that tiles an image to the background no matter the size I set it to :) package test; import java.awt.*; import java.awt.image.BufferedImage; import java.io.*; import javax.imageio.ImageIO; import javax.swing.*; public class TiledImage extends JPanel { BufferedImage tileImage; public TiledImage(BufferedImage image) { tileImage = image; } protected void paintComponent(Graphics g) { int width = getWidth(); int height = getHeight(); for (int x