import java.awt.*;
import javax.swing.*; 

public class DrawRect {
    public static void main(String[] args) {
	JFrame frame = new JFrame();
	frame.setSize(600,500);
	frame.setTitle("Draw Rectangle, Oval, Arc");
	frame.getContentPane().setBackground(Color.BLACK);

	frame.getContentPane().add(new JPanel(){
		public void paintComponent(Graphics g) {
		    setOpaque(true);
		    g.setColor(Color.GREEN);
		    g.drawRect(50,50,200,50);
		    g.fillRect(300,50,200,50);
		    g.setColor(Color.RED);
		    g.drawOval(50,150,200,50);
		    g.fillOval(300,150,200,50);
		    g.setColor(Color.BLUE);
		    g.drawArc(50,250,200,200,25,200);
		    g.fillArc(300,250,200,200,0,45);
		}
	    });

	frame.setVisible(true);
    }
}

