Skip to content

Commit

Permalink
Remove the rest of the old clipboard-relating methods
Browse files Browse the repository at this point in the history
  • Loading branch information
Deftu committed Nov 14, 2024
1 parent 48f44ad commit 649467e
Showing 1 changed file with 0 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,29 +49,6 @@ public final class IOUtils {
private IOUtils() {
}

/**
* Copy the given image to the System Clipboard.
*
* @param image the image to copy
*/
public static void copyImageToClipboard(Image image) {
ImageSelection imageSelection = new ImageSelection(image);
Toolkit.getDefaultToolkit().getSystemClipboard().setContents(imageSelection, null);
}

/**
* Return the image on the system clipboard.
*
* @return the image on the system clipboard, or null if there is no image on the clipboard or another error occurred.
*/
public static Image getImageFromClipboard() {
try {
return (Image) Toolkit.getDefaultToolkit().getSystemClipboard().getContents(null).getTransferData(DataFlavor.imageFlavor);
} catch (Exception e) {
return null;
}
}

/**
* Gets the SHA-256 hash of a file.
*
Expand Down

0 comments on commit 649467e

Please sign in to comment.