Ostatnio wpadłem na pomysł stworzenia takiego mojego małego StdDraw i napotkałem problem z wyświetlaniem się czarnego prostokąta. Pomocy? :D

import javax.swing.*;
import java.awt.*;
public class StdDraw extends Frame {

	private static final long serialVersionUID = 1L;
	
	static int x;
	static int y;
	static int width;
	static int height;
	static String text;
	static int i;
	
	public static void drawRect(int a, int b, int c, int d) {
		x=a; y=b; width=c; height=d; i=0;
		prepareGUI();
	}
	
	public void paint(Graphics g) {
        super.paint(g);
		
        g.setColor(Color.black);
		
        if (i==0) { g.fillRect(x, y, width, height); }
		
	}
	
	   private static void prepareGUI(){
		    JFrame f = new JFrame();
	        f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
	        f.add(new TestComponent());
	        f.setSize(width+x+20, height+y+20);
	        f.setVisible(true); 
			StdDraw h = new StdDraw();
	        h.repaint();
	   }	
}