Class ImageSelection

  • All Implemented Interfaces:
    java.awt.datatransfer.Transferable

    public final class ImageSelection
    extends java.lang.Object
    implements java.awt.datatransfer.Transferable
    Represents an image selection that can be selected and dragged/dropped to/from Swing components.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private javax.swing.JLabel label
      The JLabel to transfer.
    • Constructor Summary

      Constructors 
      Constructor Description
      ImageSelection​(javax.swing.JLabel label)
      Create a new image selection.
    • Field Detail

      • label

        private final javax.swing.JLabel label
        The JLabel to transfer.
    • Constructor Detail

      • ImageSelection

        public ImageSelection​(javax.swing.JLabel label)
        Create a new image selection.
        Parameters:
        label - The JLabel that this selection should hold.
    • Method Detail

      • getTransferData

        public java.lang.Object getTransferData​(java.awt.datatransfer.DataFlavor flavor)
        Specified by:
        getTransferData in interface java.awt.datatransfer.Transferable
      • getTransferDataFlavors

        public java.awt.datatransfer.DataFlavor[] getTransferDataFlavors()
        Specified by:
        getTransferDataFlavors in interface java.awt.datatransfer.Transferable
      • isDataFlavorSupported

        public boolean isDataFlavorSupported​(java.awt.datatransfer.DataFlavor flavor)
        Specified by:
        isDataFlavorSupported in interface java.awt.datatransfer.Transferable