private void setupGUI()
	{
		ucigameObject = this;
		// Create the window.
		if (!isApplet)
		{
			frame = new JFrame("No Title");
			frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		}
        gameCanvas = new GameCanvas(this);
        gameCanvas.setOpaque(true);
        if (isApplet)
        	this.getContentPane().add(gameCanvas, BorderLayout.CENTER);
        else
        	frame.setContentPane(gameCanvas);

        if (isApplet)
        {
        	this.addFocusListener(this);
		}
        else
        	frame.addFocusListener(this);

        gameCanvas.addMouseMotionListener(this);
        gameCanvas.addMouseListener(this);
        gameCanvas.addMouseWheelListener(this);
        gameCanvas.addKeyListener(this);
        gameCanvas.addFocusListener(gameCanvas);
        gameCanvas.requestFocusInWindow();

        // Let the game set up the window, especially its size.
        window.size(100, 100);		// in case setup() has no size()
  		canvas.background(255);		// in case background is not called, default is white
        setup();

        // set default framerate if none in setup
        if (goalFPS == 0)
        	framerate(10);

        // Display the window.
        if (isApplet)
			this.setVisible(true);
		else
        {
			frame.pack();
			frame.setVisible(true);
		}

		// Set up the offscreen buffer
		if (isApplet)
			offscreen = this.createImage(canvas.width(), canvas.height());
		else
			offscreen = frame.createImage(canvas.width(), canvas.height());
		System.out.flush();
		offG = (Graphics2D)offscreen.getGraphics();
		offG.setColor(bgColor);
		offG.fillRect(0, 0, canvas.width(), canvas.height());
		offG.dispose();
		offG = null;

		createEdgeSprites();

		playing = true;
	}