synchronized public void checkClipboard() {
    if (ClipboardDialog.systemClipboard != null &&
        cc.viewer.sendClipboard.getValue()) {
      Transferable t = ClipboardDialog.systemClipboard.getContents(this);
      if ((t != null) && t.isDataFlavorSupported(DataFlavor.stringFlavor)) {
        try {
          String newContents = (String) t.getTransferData(DataFlavor.stringFlavor);
          if (newContents != null && !newContents.equals(oldContents)) {
            cc.writeClientCutText(newContents);
            oldContents = newContents;
            cc.clipboardDialog.setContents(newContents);
          }
        } catch (Exception e) {
          System.out.println("Exception getting clipboard data: " + e.getMessage());
        }
      }
    }
  }