Hello) Help solve the problem: We need to create a green square image and display it.
I could draw a square, but I need to create it using java. Please help me to do this) That's what I tried to do:
import java.awt.Canvas;
import java.awt.Graphics;
import java.awt.image.BufferedImage;
import javax.swing.JFrame;
public class Game extends Canvas {
    private static final long serialVersionUID = 1L;
    private static final int WIDTH = 400;
    private static final int HEIGHT = 400;
    @Override
    public void paint(Graphics g) {
        super.paint(g);
        int w = 10;
        int h = 10;
        int type = BufferedImage.TYPE_INT_ARGB;
        BufferedImage image = new BufferedImage(w, h, type);
        int color = 257; // RGBA value, each component in a byte
        for (int x = 1; x < w; x++) {
            for (int y = 1; y < h; y++) {
                image.setRGB(x, y, color);
                g.drawImage(image, 0, 0, getWidth(), getHeight(), null);
            }
        }
    }
    public static void main(String[] args) {
        JFrame frame = new JFrame();
        frame.setSize(WIDTH, HEIGHT);
        frame.add(new Game());
        frame.setVisible(true);
    }
}
But nothing is displayed (
Let me remind the goal - to create a picture in the form of green squares, help to make it)