Movatterモバイル変換


[0]ホーム

URL:


Documentation

The Java™ Tutorials
Drag and Drop and Data Transfer
Introduction to DnD
Default DnD Support
Demo - BasicDnD
TransferHandler Class
Export Methods
Import Methods
TransferSupport Class
Setting the Drop Mode
Demo - DropDemo
Choosing the Drop Action
Demo - ChooseDropAction
Showing the Drop Location
Location Sensitive Drop
Demo - LocationSensitiveDemo
Empty Table Drop
Drop Location Rendering
Top-Level Drop
Adding Cut, Copy and Paste (CCP)
CCP in a Text Component
CCP in a non-Text Component
Using and Creating a DataFlavor
Putting it All Together - DnD and CCP
Solving Common Data Transfer Problems
Trail: Creating a GUI With Swing
Home Page >Creating a GUI With Swing
« Previous • Trail • Next »

The Java Tutorials have been written for JDK 8. Examples and practices described in this page don't take advantage of improvements introduced in later releases and might use technology no longer available.
SeeDev.java for updated tutorials taking advantage of the latest releases.
SeeJava Language Changes for a summary of updated language features in Java SE 9 and subsequent releases.
SeeJDK Release Notes for information about new features, enhancements, and removed or deprecated options for all JDK releases.

Lesson: Drag and Drop and Data Transfer

Examples Index

Drag and drop, and cut, copy and paste (collectively calleddata transfer) are essential features of most applications. But what kind of support does Swing provide and how do you take advantage of it?

For many components, when performing a drag and drop or a cut and paste operation, Swing handles all of the work for you. For a handful of components, most of the work is done for you and all that is left for you is to plug in the details of the data import and export.

This lesson provides an introduction to the data transfer mechanism used by Swing and discusses, in particular, theTransferHandler class, the workhorse of the data transfer system.

If you are interested in using JavaFX to create your GUI, seeDrag-and-Drop Feature in JavaFX Applications.

« PreviousTrailNext »

About Oracle |Contact Us |Legal Notices |Terms of Use |Your Privacy Rights

Copyright © 1995, 2024 Oracle and/or its affiliates. All rights reserved.

Previous page: Previous Lesson
Next page: Introduction to DnD

[8]ページ先頭

©2009-2025 Movatter.jp