Data transfer is the generic term for GUI mechanisms that allow an end user to transfer text or other data within an application or between applications. The two common data transfer metaphors are cut-and-paste and drag-and-drop. Java's support for data transfer has evolved over several releases:
This chapter demonstrates how you can add support for cut-and-paste and drag-and-drop to your AWT and Swing applications. It shows how to use the Swing TransferHandler class for simple cases, and how to use the underlying DataFlavor class and the Transferable interface to permit the transfer of custom data types between applications. |