public static void copyToClipboard(Object o, boolean isFormatted)
{
if (o instanceof Geometry) {
Toolkit.getDefaultToolkit().getSystemClipboard().setContents(
new GeometryTransferable((Geometry) o, isFormatted), null);
}
else
// transfer as string
Toolkit.getDefaultToolkit().getSystemClipboard().setContents(
new StringSelection(o.toString()), null);