public static boolean canAccessSystemClipboard(){
  boolean canAccess=false;
  if (!GraphicsEnvironment.isHeadless()) {
    SecurityManager sm=System.getSecurityManager();
    if (sm == null) {
      canAccess=true;
    }
 else {
      try {
        sm.checkPermission(SecurityConstants.AWT.ACCESS_CLIPBOARD_PERMISSION);
        canAccess=true;
      }
 catch (      SecurityException e) {
      }
      if (canAccess && !isTrustedContext()) {
        canAccess=canCurrentEventAccessSystemClipboard(true);
      }
    }
  }
  return canAccess;
}

public static boolean canAccessSystemClipboard ( ) { boolean canAccess = false ; if ( ! GraphicsEnvironment . isHeadless ( ) ) { SecurityManager sm = System . getSecurityManager ( ) ; if ( sm == null ) { canAccess = true ; } else { try { sm . checkPermission ( SecurityConstants . AWT . ACCESS_CLIPBOARD_PERMISSION ) ; canAccess = true ; } catch ( SecurityException e ) { } if ( canAccess && ! isTrustedContext ( ) ) { canAccess = canCurrentEventAccessSystemClipboard ( true ) ; } } } return canAccess ; }
checks the security permissions for accessing system clipboard for untrusted context ( see istrustedcontext ) checks the permissions for the current event being handled
