public static void positionAndAdd(JComponent component, double percentX,
			double percentY, double rwidth, double rheight, JComponent container)
	{
		double c_width = component.getPreferredSize().width * rwidth;
		double c_height = component.getPreferredSize().height * rheight;

		int width = container.getWidth();
		int height = container.getHeight();

		component.setBounds((int) (width * percentX - c_width / 2), // the centered x bound
				(int) (height * percentY - c_height / 2), // the centered y bound
				(int) (c_width), // the width scaled by a factor of rwidth
				(int) (c_height)); // the height scaled by a factor of rheight

		container.add(component);
	}