private void drawRect(int rx1, int ry1, int w, int h, int c, boolean fill)
    {
        if (fill)
        {
            for (int x = rx1; x < rx1 + w; x++)
                for (int y = ry1; y < ry1 + h; y++)
                    drawPoint(x, y, c);
        }
        else
        {
            for (int x = rx1; x < rx1 + w; x++)
            {
                drawPoint(x, ry1, c);
                drawPoint(x, ry1 + h - 1, c);
            }
            for (int y = ry1; y < ry1 + h; y++)
            {
                drawPoint(rx1, y, c);
                drawPoint(rx1 + w - 1, y, c);
            }
        }
    }