public static void addSingleItemCentered(JComponent component, Container container) {
		LayoutManager layout = container.getLayout();
		
		component.setMaximumSize(component.getPreferredSize());
		
		if (layout instanceof GridBagLayout) {
			GridBagLayout gridbag = (GridBagLayout) layout;
			
			c.weighty = 0;
			c.weightx = 1;
			c.fill = GridBagConstraints.BOTH;
			c.anchor = GridBagConstraints.CENTER;
			c.gridwidth = GridBagConstraints.REMAINDER; //end row
			gridbag.setConstraints(component, c);
			container.add(component);
		} else {
			Box box = Box.createHorizontalBox();
			box.add(Box.createHorizontalGlue());
			box.add(component);
			box.add(Box.createHorizontalGlue());
			container.add(box);
			container.add(component);
		}
	}