final FileTransfer fileTransfer = FileTransfer.getInstance();
final URLTransfer urlTransfer = URLTransfer.getInstance();
final UDigByteAndLocalTransfer omsboxTransfer = UDigByteAndLocalTransfer.getInstance();
Transfer[] types = new Transfer[]{fileTransfer, textTransfer, urlTransfer, omsboxTransfer};
target.setTransfer(types);
target.addDropListener(new DropTargetListener(){
@SuppressWarnings("nls")
public void drop( DropTargetEvent event ) {
if (textTransfer.isSupportedType(event.currentDataType)) {
String text = (String) event.data;
System.out.println(text);