private Color randomColor()
    {
        Color c = null;
        double d = Math.random();

        //
        // Calculate a random value between 0
        // and 5 and map this to a colour.
        //
        int colour = (int)(d * 5);

        switch (colour)
        {
            case 0:
            {
                c = Color.blue;
                break;
            }
            case 1:
            {
                c = Color.green;
                break;
            }
            case 2:
            {
                c = Color.red;
                break;
            }
            case 3:
            {
                c = Color. cyan;
                break;
            }
            case 4:
            {
                c = Color.yellow;
                break;
            }
            case 5:
            {
                c = Color.orange;
                break;
            }
        }

        return c;
    }