Drag Drop « Graphics Desktop « Java Articles

Home
Java Articles
1.Build Deploy
2.Class
3.Core Library
4.Data Types
5.Database JDBC
6.Design
7.Development
8.File Input Output
9.Graphics Desktop
10.J2EE Enterprise
11.J2ME Wireless
12.JVM
13.Language
14.Library Product
15.Network
16.Security
17.SOA Web Services
18.Test
19.Web Development
20.XML
Java Articles » Graphics Desktop » Drag Drop 

1. How to drag and drop with Java 2, Part 1    javaworld.com

Java 2 (formerly JDK 1.2) introduced the ability to transfer data using the familiar drag and drop (D&D;) metaphor. In Java 2, D&D; utilizes the underlying data-transfer mechanism introduced in JDK 1.1 (java.awt.datatransfer) for use with the clipboard. Although this article discusses D&D; operations in the context of GUI components, the specification includes no restrictions that prevent direct programmatic operations.

2. How to drag and drop with Java 2, Part 2    javaworld.com

If you need a single D&D-enabled; component, you can create a subclass that defines DragGestureListener, DragSourceListener, and DropTargetListener as inner classes. This was the technique used in the first article. If you need a number of D&D-enabled; components, you will write very similar code for each component's listeners.

3. Checker dragging    javaworld.com

Listing 1's state variables and event handlers (responding to mouse-press, mouse-release, and mouse-drag events) collectively describe checker dragging. I won't delve into how those state variables and event handlers interact because a careful study of the source code and its many comments reveals how checker dragging works. However, there is one item that I want to discuss: flicker and its elimination.

4. New Data Transfer Capabilities    java.sun.com

One of the new capabilities now available is improved data transfer support within and between applications. Data transfer includes two tasks: cut, copy, and paste access to the user or system clipboard and drag-and-drop support. Neither of these features is totally new to the standard library set. However, what you can do with them now in the 1.4 release and how you interact with the features has totally changed. Older programs, designed for the earlier data transfer mechanism, will continue to work fine, but in many cases the source code for the task can be simplified considerably.

java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.