Java Examples In A Nutshell (3rd Edition) [Electronic resources] نسخه متنی

This is a Digital Library

With over 100,000 free electronic resource in Persian, Arabic and English

Java Examples In A Nutshell (3rd Edition) [Electronic resources] - نسخه متنی

O'Reilly Media, Inc

| نمايش فراداده ، افزودن یک نقد و بررسی
افزودن به کتابخانه شخصی
ارسال به دوستان
جستجو در متن کتاب
بیشتر
تنظیمات قلم

فونت

اندازه قلم

+ - پیش فرض

حالت نمایش

روز نیمروز شب
جستجو در لغت نامه
بیشتر
لیست موضوعات
توضیحات
افزودن یادداشت جدید










Chapter 14. Data Transfer


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:

  • In Java 1.1, the java.awt.datatransfer package
    provided a data transfer infrastructure and support for the
    cut-and-paste metaphor.

  • Java 1.2 extended the data transfer infrastructure with the
    java.awt.dnd package, and added support for
    drag-and-drop.

  • In Java 1.4, the javax.swing package introduces
    the TransferHandler class, which simplifies the
    data transfer infrastructure of previous releases and makes it easier
    to provide simple drag-and-drop capabilities in a Swing application.


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.


/ 285