IO utilities
Clipboard manipulation
Obtaining a clipboard instance
Clipboard clipboard = Clipboard.getInstance();Copying and getting strings
String clipboardString = clipboard.getString();
if (clipboardString == null) {
// If the user does not have anything copied, or the copied content
// is not a string (if, f.ex, it's an image), then the `getString`
// method returns null.
return;
}
String newClipboardString = "Hello, OneConfig!";
clipboard.setString(newClipboardString); // Copies our string to the user's clipboardval clipboardString = clipboard.getString()
if (clipboardString == null) {
// If the user does not have anything copied, or the copied content
// is not a string (if, f.ex, it's an image), then the `getString`
// method returns null.
return
}
val newClipboardString = "Hello, OneConfig!"
clipboard.setString(newClipboardString) // Copies our string to the user's clipboardCopying and getting images
Copying AWT images (BufferedImage)
File checksums (SHA-256 only)
Last updated