/** * Check if SecurityManager has the clipboard locked out. * @returns true if it is this program can use the clipboard * without getting a SecurtiyException. */ private boolean isSafetToUseClipboard() { boolean safe = true; SecurityManager sm = System.getSecurityManager(); if ( sm != null ) { try { sm.checkSystemClipboardAccess(); } catch ( SecurityException e ) { safe = false; } } return safe; }