Package jexer.bits

Class Clipboard


  • public class Clipboard
    extends java.lang.Object
    Clipboard provides convenience methods to copy text and images to and from a shared clipboard. When the system clipboard is available it is used.
    • Constructor Summary

      Constructors 
      Constructor Description
      Clipboard()
      Public constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void clear()
      Clear whatever is on the local clipboard.
      void copyImage​(java.awt.image.BufferedImage image)
      Copy an image to the clipboard.
      void copyText​(java.lang.String text)
      Copy a text string to the clipboard.
      boolean isEmpty()
      Returns true if the clipboard is empty.
      boolean isImage()
      Returns true if the clipboard has an image.
      boolean isText()
      Returns true if the clipboard has a text string.
      java.awt.image.BufferedImage pasteImage()
      Obtain an image from the clipboard.
      java.lang.String pasteText()
      Obtain a text string from the clipboard.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Clipboard

        public Clipboard()
        Public constructor.
    • Method Detail

      • copyImage

        public void copyImage​(java.awt.image.BufferedImage image)
        Copy an image to the clipboard.
        Parameters:
        image - image to copy
      • copyText

        public void copyText​(java.lang.String text)
        Copy a text string to the clipboard.
        Parameters:
        text - string to copy
      • pasteImage

        public java.awt.image.BufferedImage pasteImage()
        Obtain an image from the clipboard.
        Returns:
        image from the clipboard, or null if no image is available
      • pasteText

        public java.lang.String pasteText()
        Obtain a text string from the clipboard.
        Returns:
        text string from the clipboard, or null if no text is available
      • isImage

        public boolean isImage()
        Returns true if the clipboard has an image.
        Returns:
        true if an image is available from the clipboard
      • isText

        public boolean isText()
        Returns true if the clipboard has a text string.
        Returns:
        true if a text string is available from the clipboard
      • isEmpty

        public boolean isEmpty()
        Returns true if the clipboard is empty.
        Returns:
        true if the clipboard is empty
      • clear

        public void clear()
        Clear whatever is on the local clipboard. Note that this will not clear the system clipboard.