@Override
	synchronized public void paint (Graphics g)
	// repaint the board (generate images at first call)
	{
		Dimension d = getSize();
		// test if ActiveImage is valid.
		if (Dim.width != d.width || Dim.height != d.height)
		{
			Dim = d;
			makeimages();
			repaint();
			return;
		}
		else
		{
			if (ActiveImage != null) g.drawImage(ActiveImage, 0, 0, this);
		}
		if ( !Activated && GF.boardShowing())
		{
			Activated = true;
			GF.activate();
		}
		g.setColor(GF.backgroundColor());
		if (d.width > W) g.fillRect(W, 0, d.width - W, W);
		if (d.height > W) g.fillRect(0, W, d.width, d.height - W);
	}