public void paintBorder(Component c, Graphics g, int x, int y, int w, int h)
	{
		// choose which colors we want to use
		Color bg = c.getBackground();

		if (c.getParent() != null)
		{
			bg = c.getParent().getBackground();
		}

		if (bg != null)
		{
			Color mid = bg.darker();
			Color edge = average(mid, bg);

			g.setColor(bg);
			g.drawLine(0, h - 2, w, h - 2);
			g.drawLine(0, h - 1, w, h - 1);
			g.drawLine(w - 2, 0, w - 2, h);
			g.drawLine(w - 1, 0, w - 1, h);

			// draw the drop-shadow
			g.setColor(mid);
			g.drawLine(1, h - 2, w - 2, h - 2);
			g.drawLine(w - 2, 1, w - 2, h - 2);

			g.setColor(edge);
			g.drawLine(2, h - 1, w - 2, h - 1);
			g.drawLine(w - 1, 2, w - 1, h - 2);
		}
	}