import java.awt.*;
import java.awt.event.*;
import javax.swing.*;

public class DrawingMac extends JPanel
{
    static int maxX = 400;
    static int maxY = 400;
    
    public DrawingMac ()
    {
	super (new BorderLayout ());
	repaint ();
    }

    public void paint (Graphics g)
    {
	g.setColor (Color.white);
	g.fillRect (0, 0, maxX, maxY);

	g.setColor (Color.red);
	g.fill3DRect (100, 100, 150, 150, true);
	g.fill3DRect (250, 250, 50, 50, true);
    }


    public static void main (String[] args)
    {
	//Make sure we have nice window decorations.
	JFrame.setDefaultLookAndFeelDecorated (true);

	//Create and set up the window.
	JFrame frame = new JFrame ("Drawing Demo");
	frame.setDefaultCloseOperation (JFrame.EXIT_ON_CLOSE);

	//Create and set up the content pane.
	JComponent newContentPane = new DrawingMac ();
	newContentPane.setOpaque (true); //content panes must be opaque
	frame.setContentPane (newContentPane);
	frame.setSize (maxX, maxY);

	//Display the window.
	frame.setVisible (true);
    }
}
