Drag and DROP: New Data Transfer Capabilities in The Javatm 2 Platform, Standard Edition (J2SETM), Version 1.4

zhaozj2021-02-17  47

New Data Transfer Capabilities

John Zukowskinovember 2001

Sun is currently undergoing their third beta release of the JavaTM 2 Platform, Standard Edition (J2SETM), version 1.4. This latest release incorporates many new and interesting features into the standard library set, some of which have been available as standard extensions for some time . These would include capabilities like the Java Cryptography Extension (JCE), Java Secure Socket Extension (JSSE), Java Authentication and Authorization Service (JAAS), the Java API for XML Processing (JAXP), and JDBC extensions. All of these libraries have BEEN AVAILABLE As Optional Libraries and Work with Prior Versions of The Java 2 Platform. Now, They Just Come Standard.

In addition to adding previously optional packages to the standard library set, the 1.4 release also incorporates many new features. These totally new elements include new Swing components, new I / O management, and a new assert keyword in the language. Features like these are NOT BAKWARD Compatible and Are Not Available As Optional Libraries for Earlier Releases of The Java 2 Platform.

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.

Before looking ion ly to use the drag-and -ddless, version 1.4 Release, There is some background information you need to understand.clipboards

First off is a look at clipboards. If you are not familiar with what a clipboard is, it is a memory area for storing information in support of cut, copy, and paste operations. For instance, when you are using a word processor and cut a piece of text to place the text elsewhere in the document, the text that was cut is saved within the clipboard. When it becomes time to paste the text, the paste operation reads what is on the clipboard and pastes it into the document.

There are actually multiple clipboards available. There is one global clipboard that all applications have access to, and private clipboards that can be limited in scope to within a single application. By utilizing a private clipboard in an application, you do not copy into system Memory What Goes Onto The System Clipboard. Instead, IT Stays Wtem.

Transferable Objects

While you now know what a clipboard is, you have not learned anything about the objects that can go into the clipboard. With the Java platform, objects that can be placed within a clipboard must implement the Transferable interface, found in the java.awt .DATATRANSFER PACKAGE.

Public interface transferable {

Public Object GetTransferData (DataFlavor Flavor)

Throws unsupportedflavorException, IOException;

Public DataFlavor [] getTransferDataflavors ();

Public Boolean IsDataflavorsupported (DataFlavor

Flavor);

}

The interface talks about an object called DataFlavor, but what's a flavor? Quite simply, data flavors are ways of representing data. In the Web world, you might have heard the term MIME types, where MIME stands for Multipurpose Internet Mail Extensions. MIME types allow you to say that an email attachment is an image or the Web document to deliver through your web server is a text file. Data flavors are just the way of representing MIME types within your programs.MIME types have textual representations like text / html or text / plain. Data flavors on the other hand are classes. Flavors get created by textual representations, but they are classes in the system. They are used by the data transfer mechanism so that when you place something on the clipboard, you can state what type of object it is. Then, when someone gets something off the clipboard, that someone can ask what flavors of data are available. If all the flavors are ones they do not support, they can not get the object off the clip Board.

What's this about multiple flavors? You provide data through the data transfer mechanism with multiple flavors so that you can support the widest possible audience. For instance, if you were to copy text within a word processor, you would want to retain the formatting information. However, if you were to paste the text into something that did not support the formatting, would not you at least want to be able to get the actual text content? that's how flavors work. you specify that the transferable data can be represented by one or more flavors. you provide the means to check if a particular flavor is supported, and then you provide the mechanism to get the data for a specific flavor. and that is exactly what the Transferable interface does for you.DataFlavor itself is a class. It makes several default flavor and MIME types available through class constants and a method. Going from simplest to most complex, you get predefined flavors for plain text, strings, a file list, and images. There Are Also Three Mime Types Defined for Local, Serialized, And Remote Objects. from The Mime Types, You Create The Flavors.

GetTextPlainunicodeflavor Stringflavor JavaFileListflavor Imageflavor JavajvmlocalObjectMimens JavaSeriZedObjectMimensPe JavareMoteObjectMimens

Using the word processor example, imagine if that word processor was your program and you wanted to support cut and paste of the content of your document. You might present the content in four different flavors. The first flavor would be the local object type. If cut-and-paste is happening within the same application, using the javaJVMLocalObjectMimeType allows you to just use a local memory reference for the copy operation. Going between different Java applications would allow you to create a flavor from javaSerializedObjectMimeType. Here, the content is serialized , and you would be able to preserve any formatting information. The last two are stringFlavor and getTextPlainUnicodeFlavor. Both lose all formatting information, but still permit you to copy the contents.Transferring string objects is a common task so you'll find a StringSelection class In the java.awt.datatransfer package to help you. as it Only Works with strings, The class doesn't support the local / serialized type job Mentioned.

Now That You Have Some Background Information, Let's Move on To Some Real Code.

Buffers

The clipboard acts as an indirect buffer. When you make something available to the clipboard, you do not actually copy the data there. Instead, you copy a reference and that reference is accessed when you want to take something off the buffer. Because you May NEED TO Keep Track of That External Reference, The Clipboard Will Actually Notify You at The Clipboard. That Notification IS Handled by The Clipboardowner Interface:

Public interface clipboardowner {

Public Void Lostownership (Clipboard CLIP,

Transferable T);

}

This means that there is no built-in support for having multiple items on the clipboard. When something new is added to the clipboard, the old reference is thrown away.To demonstrate the use of the system clipboard, take a look at the StringSelection class . It implements both the Transferable and ClipboardOwner interfaces. You use it to transfer strings to the clipboard. Adding a string to the clipboard involves creating a StringSelection item and setting the clipboard contents, through its setContents method. Here's what the code for that task looks Like.

// Get String

String selection = ...;

// convert to stringselection

StringSelection Data = New StringSelection (SELECTION);

// Get System CLIPBOARD

Clipboard clipboard =

Toolkit.getDefault (). GetSystemClipboard ();

// SET Contents

Clipboard.SetContents (Data, DATA);

Getting The Clipboard Data IS A Little More Involved, But Not Too Difficult. There Are Basical Three Steps Involved:

Get The Reference To The Data from The Clipboard, The Transferable Object. Find A Flavor You Can Handle That Supports, Where DataFlavor.StringFlavor Is for Text Strings. Get The Data For That Flavor.

And, Here's What That Code Looks Like. There's Also A Bit of Exception Handling Necessary As a UnsupportedflavorException Or IOException COULD BE thROWN.

// Get Data from Clipboard

TRANSFERABLE CLIPDATA =

Clipboard.getContents (Clipboard); CLIPBOARD

// Make Sure Not Empty

IF (clipdata! = null) {

// Check if it supports the Desired Flavor

IF (Clipdata.isDataflavorsupported

(DataFlavor.Stringflavor) {

// Get Data

String s = (string) (Clipdata.getTransferData)

DataFlavor.StringFlavor);

// USE DATA

...

}

}

Clipboard Text Example

As shown in the following figure, the sample program that puts all these pieces together involves a text area and two buttons, Copy and Paste. When the Copy button is selected, the current selection within the text area is copied to the system clipboard. When the Paste button is selected, the current selection will be replaced with the contents of the system clipboard. If the flavor of data on the clipboard is not supported, the system beeps. Most of the code involves just the screen setup. There should be no New Code As Far As The Clipboard Access.and, Here's The Complete Source.

Import java.awt. *;

Import java.awt.event. *;

Import java.awt.datatransfer. *;

Import javax.swing. *;

Public class clipboardexample {

Public static void main (string args []) {

JFrame Frame = New JFrame ("Copy / Paste");

Container contentpane = frame.getContentPane ();

Final Toolkit Kit = Toolkit.getDefaultToolkit ();

Final CLIPBOARD CLIPBOARD =

Kit.getsystemClipboard ();

Final JTextArea JT = New Jtextarea ();

JscrollPane Pane = New JScrollPane (JT);

ContentPane.Add (Pane, BorderLayout.center);

JPanel bottom = new jPanel ();

JButton Copy = New JButton ("Copy");

Bottom.Add (Copy);

ActionListener COPYLISTENER = New

ActionListener () {

Public Void ActionPerformed (ActionEvent E) {

String selection = jt.getSelectedText ();

StringSelection Data = New

StringSelection (SELECTION);

Clipboard.SetContents (Data, DATA);

}

}

Copy.AddActionListener (COPYLISTENER);

JButton Paste = New JButton ("Paste");

BotTom.Add (Paste);

ActionListener Pastelistener = New

ActionListener () {

Public Void ActionPerformed (ActionEvent

ActionEvent) {

TRANSFERABLE CLIPDATA =

Clipboard.getContents (Clipboard); if (ClipData! = NULL) {

Try {

IF (Clipdata.isDataflavorsupported

Dataflavor.stringflavor) {

String s =

(String) (Clipdata.getTransferData)

DataFlavor.StringFlavor);

Jt.replaceselection (s);

} else {

Kit.beep ();

}

} catch (exception e) {

System.err.println ("Problems Getting Data:

" e);

}

}

}

}

Paste.addActionListener (Pastelistener);

ContentPane.Add (Bottom, BorderLayout.South);

Frame.setDefaultCloseOperation

(Jframe.exit_on_close);

Frame.setsize (300, 300);

Frame.show ();

}

}

When trying out the program, be sure to try to copy and paste between native applications like your word processor. Because you are using the system clipboard, the program will transfer whatever the contents of the clipboard are.

Text actions

While this article is about explaining the data transfer mechanisms with the J2SE libraries, the code for copy and paste does not have to be that complicated when using the Swing text controls. They already know how to do cut, copy, and paste operations, Among Many Other Tasks. All you have to do is lookup the appropriate listener and add what INSTEAD.

The actions associated with the text controls are retrieved through the getActions method. This returns an array of Action objects, which implement the ActionListener interface. You just need to find the specific listener and attach that instead. The following code will do just that. It Replaces The Creation of The Two ActionListener Objects and Their Attachment In The Prior Example.

// Get Command Table

Action actions [] = jt.getActions ();

// Find the Two Wanted

INT count =

For

(int i =

0, n = actions.lendth; (i <

N) && (count <2);

i ) {action a = actions [i];

String name = (string) A.GetValue (action.name);

IF (name.equals (defaultitorkit.copy) {

Copy.AddActionListener (a);

COUNT ;

Else IF (Name.Equals)

(Defaultitorkit.pasteaction)) {

Paste.addActionListener (a);

COUNT ;

}

}

TRANSFERRING IMAGES

Now that the basic process of transferring text has been explained, let's move on to something new to the 1.4 release of J2SE, images transfers. Prior versions of the J2SE did not provide integrated support for transferring images between Java programs and native applications. While you could go through the manual process of providing the data in an understandable format, that task is no longer necessary. All you now have to do is specify that the flavor is of type DataFlavor.imageFlavor, provide the data to the clipboard as an AWT Image object, and you're all set.

While the process of transferring a String is done through the StringSelection class, there is no such class available for transferring images. You must create your own Transferable object that implements ClipboardOwner, too. If StringSelection is for transferring String objects, the logical name for transferring Images is imageseelection.

If you plan on creating transferable objects that will interact with Swing components, you do not have to implement the two interfaces yourself. Instead, there is a helper TransferHandler class that does most of the work for you. The handler does the interaction with the Clipboard, And You Just Have To Override Four of Its Methods:

public int getSourceActions (JComponent c) - Returns the supported operations There are four constants in the TransferHandler class for the operations:.. COPY, COPY_OR_MOVE, MOVE, and NONE public boolean canImport (JComponent comp, DataFlavor flavor []) - Returns true if the component can support one of the data flavors, false otherwise public Transferable createTransferable (JComponent comp) -. Here, you need to save a reference to the data to be transferred, and return the TransferHandler (this) The component represents. where the data is coming from This is your copy operation The handler does the actual copy to the clipboard at the appropriate time public boolean importData (JComponent comp, Transferable t) -... Returns true if the component supports getting one of the data flavors from the Transferable object, and successfully gets it, false otherwise. This is your paste operation. Again, the handler gets the data from the clipboard, you just have to get it from the Transferable.He RE's Just Such a class definition That Works with all AbstractButton Subclasses and the jlabel component.

Import java.awt. *;

Import java.awt.datatransfer. *;

Import java.io. *;

Import javax.swing. *;

Public class imageselection extends TransferHandler

Implements transferable {

Private static final dataflavor flavors [] =

{Dataflavor.imageflavor};

PRIVATE Image;

Public int GetSourcenesss (JComponent C) {

Return Transferhandler.copy;

}

Public Boolean Canimport (JComponent Comp, DataFlavor

Flavor []) {

IF (! (CoMP instanceof jlabel) ||

(Comp InstanceOf AbstractButton) {

Return False;

}

For (int i = 0, n = flavor.length; i

IF (Flavor [I]. Equals (Flavors [0])) {

Return True;

}

}

Return false;}

Public Transferable CreateTransferable (JComponent

CoMP) {

// clear

Image = null;

Icon icon = null;

Comp InstanceOf Jlabel {

Jlabel label = (jlabel) Comp;

Icon = label.geticon ();

} else if (Comp InstanceOf AbstractButton) {

AbstractButton Button = (AbstractButton) Comp;

iCon = button.geticon ();

}

Icon InstanceOf Imageicon {

Image = (imageicon) .Getimage ();

Return this;

}

Return NULL;

}

Public Boolean ImportData (JComponent CoMP,

Transferable t) {

Imageicon icon = NULL;

Try {

IF (T.IsDataflavorsupported (Flavors [0])) {

Image = (image) T. GetTransferData (Flavors [0]);

iCon = New Imageicon (Image);

}

Comp InstanceOf Jlabel {

Jlabel label = (jlabel) Comp;

Label.Seticon (ICON);

Return True;

} else if (Comp InstanceOf AbstractButton) {

AbstractButton Button = (AbstractButton) Comp;

Button.seticon (icon);

Return True;

}

} catch (unsupportedflavorexception @) {

} catch (ioexception ignored) {

}

Return False;

}

// Transferable

Public Object GetTransferData (DataFlavor Flavor) {

IF (IsDataFlavorsupported (Flavor) {

Return image;

}

Return NULL;

}

Public DataFlavor [] getTransferDataflavors () {

Return Flavors;

}

Public Boolean IsDataflavorsupported (DataFlavor

Flavor) {

Return flavor.equals (Flavors [0]);

}

}

The following program demonstrates the ImageSelection class There will be both a JLabel and JButton that uses the ImageSelection as its transfer handler In the case of the label, three buttons will support different tasks:.. Copying the image on the label to the clipboard, pasting An Image On The Clipboard to The Label, And Clearing The Label. For The Button, Selection Will Act As a Paste Operation.

Associating an ImageSelection as the transfer handler for a component is not sufficient for the behavior part of the program to work. You must create an ActionListener to associate to the button and call the necessary TransferHandler method to move the data. As previously mentioned, exportToClipboard . will copy the image off the component, and importData will paste it Like with pasting strings, you still need to get the Transferable off the clipboard though.TransferHandler handler = label.getTransferHandler ();

// COPY

Handler.ExportToclipboard (label, clipboard,

Transferhandler.copy;

// paste

TRANSFERABLE CLIPDATA =

Clipboard.getContents (Clipboard); CLIPBOARD

IF (clipdata! = null) {

IF (Clipdata.isDataflavorsupported

(DataFlavor.imageflavor) {

Handler.Importdata (Label, Clipdata);

}

}

To support pasting with the button component, you could do the same thing, but it is not necessary. If the component that is to trigger the transfer is the source of the event, all you have to do is get the ActionListener right from the . TransferHandler There are three static methods for just such an operation:. getCopyAction, getCutAction, and getPasteAction Here's all the code that is necessary to have button selection trigger pasting of the clipboard contents to the button, setting its icon label.

JButton Pasteb = New JButton ("Paste");

Pasteb.SetTransferHandler (new imageseection ());

Pasteb.addactionListener

TransferHandler.getPasteAction ());

Putting All this Together Becomes a Complete Test Program:

Import java.awt. *;

Import java.awt.event. *;

Import java.awt.datatransfer. *;

Import javax.swing. *;

Import java.io.ioException;

Public class imagecopy {

Public static void main (string args []) {

JFrame Frame = New Jframe ("Copy Image");

Frame.setDefaultCloseOperation

(Jframe.exit_on_close);

Container contentpane = frame.getContentPane ();

Toolkit Kit = Toolkit.getDefaultToolkit ();

Final CLIPBOARD CLIPBOARD =

Kit.getsystemClipboard ();

Icon icon = new imageicon ("scott.jpg");

Final Jlabel Label = New Jlabel (icon);

Label.SetTransferHandler (new imageseection ());

JscrollPane Pane = New Jscrollpane (Label);

ContentPane.Add (Pane, BorderLayout.center);

JButton Copy = New JButton ("Label Copy");

Copy.AddActionListener (New ActionListener () {

Public Void ActionPerformed (ActionEvent E) {

TransferHandler Handler =

Label.gettransferhandler ();

Handler.ExportToclipboard (label, clipboard,

Transferhandler.copy;

}

});

JButton Clear = New JButton ("Label Clear");

Clear.addActionListener (New ActionListener () {

Public Void ActionPerformed (ActionEvent

ActionEvent) {

Label.seticon (NULL);

}

});

JButton Paste = New JButton ("Label Paste");

Paste.addActionListener (New ActionListener () {

Public Void ActionPerformed (ActionEvent

ActionEvent) {

TRANSFERABLE CLIPDATA =

Clipboard.getContents (Clipboard); CLIPBOARD

IF (clipdata! = null) {

IF (Clipdata.isDataflavorsupported

(DataFlavor.imageflavor) {

TransferHandler Handler =

Label.gettransferhandler ();

Handler.Importdata (Label, Clipdata);

}

}

}

});

JPANel P = new jPanel ();

p.Add (copy);

P.Add (Clear);

P.ADD (Paste);

Contentpane.Add (p, borderlayout.north);

JPanel Pastep = New JPANEL ();

JButton Pasteb = New JButton ("Paste");

Pasteb.SetTransferHandler (new imageseection ());

Pasteb.addactionListener

TransferHandler.getPasteAction ());

Pastep.add (Pasteb); ContentPane.Add (Pasteb, BorderLayout.South);

Frame.setsize (400, 400);

Frame.show ();

}

}

When run, the program will look like the following screen, however, your images will probably differ. Try to copy only small images to the button as it is not in a JScrollPane. Only the label supports large images.

DRAG & DROP

This leads us up to how the 1.4 release of the J2SE supports drag-and-drop operations. The drag-and-drop operation is the transferring of data between objects, triggered by a gesture of the mouse or other pointing device. Prior versions of the platform required intricate work to get drag-and-drop going. For the new release, times have changed considerably. In some cases, all you have to do is call the setDragEnabled method of the component. In other cases, you need to associate ...................

For instance, if you want to support Drag-and-drop operations with the set you have to do is call the setdragenabled method of the class, and the contents of the field are Draggable.

JtextField TF = New JtextField ();

Tf.SetDragenabled (True);

This Default Behavior Is Available with Many of The Swing Components:

JColorchooser JeditorPane Jfilechooser JformattedTextField Jlist JPasswordfield JTable JtextArea JtextField JtextPane JTree

Here's a simple program to demonstrate how easy drag-and-drop operations are with the new release of J2SE. It provides a JTextField and a JTree, both of which have drag enabled. The JTextField also supports drop operations, so you can drag something from The Tree to The Text Field, But You Must Do Additional Work to Enable Drop on a jtree component.import java.Awt. *;

Import java.awt.datatransfer. *;

Import javax.swing. *;

Public class dragon {

Public static void main (string args []) {

JFrame Frame = New Jframe ("First Drag");

Frame.setDefaultCloseOperation

(Jframe.exit_on_close);

Container contentpane = frame.getContentPane ();

JTree Tree = New JTREE ();

JscrollPane Pane = New Jscrollpane (Tree);

ContentPane.Add (Pane, BorderLayout.center);

Tree.SetDragenabled (TRUE);

JtextField TF = New JtextField ();

Tf.SetDragenabled (True);

Contentpane.Add (TF, BorderLayout.North);

Frame.setsize (300, 300);

Frame.show ();

}

}

In order to drag a node from the tree, you must select the icon associated with the specific node. Also, be sure to try to drag multiple selected nodes from the JTree component. This will drag the entries as an ordered HTML list.

While some components have built-in support for drag-and-drop operations, not all do. For instance, if you wanted to support dragging the image on a JLabel, you would have to initiate the drag operation yourself when the mouse was pressed over The Component.

Mouselistener mouselistener = new mouseadapter () {

Public void mousepressed (mouseevent e) {

JComponent Comp = (jcomponent) E.Getsource ();

TransferHandler Handler =

Comp.getTransferHandler ();

Handler.Exportasdrag (Comp, E,

Transferhandler.copy;

}

}

label.addMouseListener (mouseListener); As long as you associate the earlier ImageSelection handler as the TransferHandler for the component, you can drag off the image to a native application that accepts image input It is that easy..

The ImageSelection handler is a little special in the sense that it does not transfer a property of the button / label. Instead it gets the Image from the Icon property of the component. When the transferable object actually is a property of the component, the creation of the handler can be done much more easily. The TransferHandler class has a constructor that accepts a property name as the constructor argument. Then, when you associate the handler with a Swing component, it knows how to acquire the appropriate content.

For instance, if you wanded to support the Dragging of the text label for a jlabel, The Following Work to create the Transferhandler for the lambel and associate it with the component:

TransferHandler Handler = New TransferHandler ("Text");

Jlabel label = new Jlabel ("Welcome");

Label.SetTransferHandler (Handler);

You 10. '' '' '' '' '' '' '' '' '

If a Swing component does not provide built in drop support, you have to add that in yourself. The code to get the data being transferred via the drag-and-drop operation is identical to getting the data from the clipboard. You only need To associate the behavior with some triggering action, Like When the mouse is release over a company:

MouseListener ReleaseListener = new mouseadapter () {

Public void mouseeleased (mouseevent e) {

Transferable clipdata = clipboard.getcontents (clipboard);

IF (clipdata! = null) {

IF (Clipdata.isDataflavorsupported

(DataFlavor.imageflavor) {

TransferHandler Handler =

Component.gettransferhandler ();

Handler.Importdata (Component, Clipdata);

}

}

}

}

.

Import java.awt. *;

Import java.awt.event. *;

Import java.awt.datatransfer. *;

Import javax.swing. *;

Public class dragtwo {

Public static void main (string args []) {

JFrame Frame = New Jframe ("Second Drag");

Frame.setDefaultCloseOperation

(Jframe.exit_on_close);

Container contentpane = frame.getContentPane ();

Toolkit Kit = Toolkit.getDefaultToolkit ();

Final CLIPBOARD CLIPBOARD =

Kit.getsystemClipboard ();

JtextField TF = New JtextField ();

Contentpane.Add (TF, BorderLayout.North);

Icon icon = new imageicon ("scott.jpg");

Jlabel label1 = new Jlabel (icon);

Label1.SetTransferHandler (new imageseection ());

Mouselistener presslistener = new mouseadapter () {

Public void mousepressed (mouseevent e) {

JComponent Comp = (jcomponent) E.Getsource ();

TransferHandler Handler =

Comp.getTransferHandler ();

Handler.exportasdrag

(Comp, E, TransferHandler.copy;

}

}

Label1.addmouselistener (PRESSLISTENER);

TransferHandler Handler = New

TransferHandler ("Text");

Jlabel label2 = new Jlabel ("Drag Me");

Label2.setTransferHandler (Handler);

Label2.addmouselistener (PressListener);

JPanel Panel = new jPanel ();

Panel.add (label1);

Panel.add (label2);

ContentPane.Add (Panel, BorderLayout.South); Final Jlabel Dropzone = New Jlabel ();

Dropzone.setTransferHandler (new imageselection ());

MouseListener ReleaseListener =

NEW mouseadapter () {

Public void mouseeleased (mouseevent e) {

Transferable clipdata = clipboard.getcontents

(clipboard);

IF (clipdata! = null) {

IF (Clipdata.isDataflavorsupported

(DataFlavor.imageflavor) {

TransferHandler Handler =

Dropzone.gettransferhandler ();

Handler.Importdata (Dropzone, Clipdata);

}

}

}

}

Dropzone.addmouselistener (ReleaseListener);

JscrollPane Pane = New Jscrollpane (Dropzone);

ContentPane.Add (Pane, BorderLayout.center);

Frame.setsize (400, 400);

Frame.show ();

}

}

As shown here, the new J2SE, version 1.4 release makes adding drag-and-drop support to your applications very, very simple. With the added support for transferring images through either the system clipboard or through drag-and-drop operations, what more COULD you ask for? throw in all the other new features being added to the 1.4 release and it is sue to becom.

Resources

New Swing Data Transfer Summary Example of The Older Drag-and-Drop Capability

转载请注明原文地址:https://www.9cbs.com/read-28629.html

New Post(0)