3. TEXT COMPONENTS WITH CUSTOM VIEWS

Java > Core SWING advanced programming > 8. DRAG-AND-DROP

 

Chapter 8. DRAG-AND-DROP

Topics in this Chapter

  • The Drag Source

  • The Drop Target

  • The Lifecycle of a Drag-and-Drop Operation

  • Dragging Files

  • Transferring Text Using Drag-and-Drop

  • Implementing Drag-and-Drop for Tree Structures

This chapter looks at the drag-and-drop feature that was introduced in the Java 2 platform. Although it isn't strictly part of Swing, drag-and-drop comes within the somewhat larger scope of the Java Foundation Classes and there is no doubt that making proper use of this feature can greatly enhance the user interface of all but the simplest of applications. Drag-and-drop builds on the data transfer feature originally introduced to support cut-and-paste in Java Developer's Kit (JDK) 1.1. Because of this dependency, there is extensive coverage of the data transfer mechanism in this chapter and much of what you'll read here will also be of use if you plan to implement a cut-and-paste mechanism beyond that provided by the Swing text components. Note that drag-and-drop is not supported by JDK 1.1, so you won't be able to compile or run the examples in this chapter if you are still working with JDK 1.1.

 

 



Core Swing
Core Swing: Advanced Programming
ISBN: 0130832928
EAN: 2147483647
Year: 1999
Pages: 55
Authors: Kim Topley

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net