ClipboardUtil

Introduction

Following the strong demand from Hutool community members, ClipboardUtil class was added in version 3.2.0+ to simplify the operation of clipboard (although its usage scenarios are limited).

Usage

ClipboardUtil encapsulates several commonly used static methods:

General methods

  1. getClipboard - to get the system clipboard
  2. set - to set content to the clipboard
  3. get - to get the content from the clipboard

Methods specific to text

  1. setStr - to set text to the clipboard
  2. getStr - to get text from the clipboard

Methods specific to Image objects (images)

  1. setImage - to set an image to the clipboard
  2. getImage - to get an image from the clipboard