Product
Introducing License Enforcement in Socket
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
com.github.fracpete:jclipboardhelper
Advanced tools
Helper library for dealing with the System clipboard in Java.
Helper library for dealing with the sytem's clipboard in Java.
You can use the following dependency in your pom.xml
:
<dependency>
<groupId>com.github.fracpete</groupId>
<artifactId>jclipboardhelper</artifactId>
<version>0.1.2</version>
</dependency>
Copy to clipboard
java.lang.String
java.awt.image.BufferedImage
javax.swing.JComponent
-- creates images from itjavax.swing.JTable
-- call the table's copy actionjava.awt.datatransfer.Transferable
-- supply your own implementationPaste from clipboard
java.lang.String
java.awt.image.BufferedImage
java.awt.datatransfer.Transferable
-- returns just an Object
Example code for copying data to the clipboard:
import java.awt.image.BufferedImage;
import com.github.fracpete.jclipboardhelper.ClipboardHelper;
...
// string
ClipboardHelper.copyToClipboard("Hello World");
// image
BufferedImage img = ... // from somewhere
ClipboardHelper.copyToClipboard(img);
Example code for obtaining data from the clipboard:
import java.awt.image.BufferedImage;
import com.github.fracpete.jclipboardhelper.ClipboardHelper;
...
// string available?
if (ClipboardHelper.canPasteStringFromClipboard()) {
String s = ClipboardHelper.pasteStringFromClipboard();
}
// image available?
if (ClipboardHelper.canPasteImageFromClipboard()) {
BufferedImage img = ClipboardHelper.pasteImageFromClipboard();
}
Example for clearing the clipboard:
import com.github.fracpete.jclipboardhelper.ClipboardHelper;
...
ClipboardHelper.clearClipboard();
FAQs
Helper library for dealing with the System clipboard in Java.
We found that com.github.fracpete:jclipboardhelper demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
Product
We're launching a new set of license analysis and compliance features for analyzing, managing, and complying with licenses across a range of supported languages and ecosystems.
Product
We're excited to introduce Socket Optimize, a powerful CLI command to secure open source dependencies with tested, optimized package overrides.