Fill Rectangle & Square - Java 2D Graphics

Java examples for 2D Graphics:Rectangle

Description

Fill Rectangle & Square

Demo Code


import java.applet.Applet;
import java.awt.Color;
import java.awt.Graphics;
 
public class Main {
        public void paint(Graphics g){
                g.fillRect(10,10,50,100);
                g.fillRect(100,100,50,50);
        }//from w  w w . ja  va2  s .c  om
 
}

Related Tutorials