Drag and drop in windowed application
i have created application using drag and drop funcatinalities .it's working in webbrowser as internet application .but i converted int o a windowed application and dra and drop isn't working in that form as desktop app.
pls help me
thank you.
Maybe I should mention that this drag and drop feature doesn't work on ALL the programs, which leads me to believe that this is a system preferences problem. I can't drag into any of the Adobe programs, iPhoto, Kodak Easyshare, etc.
I understand the Get Info solution, but that is pinpointing only one type of file... I would like to fix this feature for all files.
Thanking in advance, Ck
Similar Messages
-
Drag and drop to Windows desktop
Hi
I've been struggling with this for a while, I've got a TransferHandler class that allows drag and drop from Windows desktop to application, now I'd like to do the reverse, but can't seem to provide the suitable DataFlavor to the OS, I'm using javaFileListFlavor obviously. I am currently creating a Transferable with createTransferable, but this is a StringSelection, and I can't remove this because I need it for internal drag and drop in the application. Please advise.
public class CDrag extends TransferHandler {
public CDrag(TreeTableView ttv) {
this.ttv = ttv;
dndData = new ArrayList();
relPath = "/";
try {
uriFlavor = new DataFlavor("text/uri-list;class=java.lang.String");
} catch (ClassNotFoundException e) {
@Override
public int getSourceActions(JComponent c) {
return MOVE;
@Override
protected Transferable createTransferable(JComponent c) {
String nodes = "";
int j = 0;
TreePath[] sel = ttv.treeTable.getTreeSelectionModel().getSelectionPaths();
for (TreePath i : sel) {
FileNode fNode = (FileNode) i.getLastPathComponent();
if (j > 0) {
nodes = nodes + "\n";
nodes = nodes + fNode.toString();
j++;
return new StringSelection(nodes);
@Override
protected void exportDone(JComponent c, Transferable t, int action) {
if (!dndData.isEmpty()) {
File[] sg = (File[]) dndData.toArray();
// delete files that are dropped
dndData.clear();
@Override
public boolean canImport(TransferSupport supp) {
if (supp.isDataFlavorSupported(DataFlavor.stringFlavor)) {
return true;
if (supp.isDataFlavorSupported(DataFlavor.javaFileListFlavor)) {
return true;
if (supp.isDataFlavorSupported(uriFlavor)) {
return true;
return false;
private boolean importFiles(TransferSupport supp, File[] files) {
// function that recursively processes all files and folders
@Override
public boolean importData(TransferSupport supp) {
if (!canImport(supp)) {
return false;
String fns = "";
Transferable t = supp.getTransferable();
try {
if (supp.isDataFlavorSupported(DataFlavor.javaFileListFlavor)) {
File[] fnsl = (File[]) ((List) t.getTransferData(DataFlavor.javaFileListFlavor)).toArray();
return importFiles(supp, fnsl);
} else if (supp.isDataFlavorSupported(uriFlavor)) {
String s = (String)t.getTransferData(uriFlavor);
StringTokenizer st = new StringTokenizer(s, System.getProperty("line.separator"));
ArrayList files = new ArrayList<File>();
while (st.hasMoreTokens()) {
String file = st.nextToken();
try {
URL url = new URL(file);
files.add(new File(URLDecoder.decode(url.getPath())));
} catch (MalformedURLException mue) {
return importFiles(supp, (File []) files.toArray());
} else {
fns = (String) t.getTransferData(DataFlavor.stringFlavor);
} catch (UnsupportedFlavorException ex) {
Logger.getLogger(CDrag.class.getName()).log(Level.SEVERE, null, ex);
} catch (IOException ex) {
Logger.getLogger(CDrag.class.getName()).log(Level.SEVERE, null, ex);
// the rest of the code here process a StringSelection
return true;
private List<File> dndData;
private String relPath;
private DataFlavor uriFlavor;
}I have the following information available in the FileNode class - the name of the file, the path inside the application, date modified, size, whether it is a file or folder. How do I get these values into a javaFileListFlavor that Windows will understand? Also, I would need a way of returning the actual file data (which will be read from a remote server). The basic File class doesn't allow many of these things to be set.
Regards
LionelI have the following information available in the FileNode class - the name of the file, the path inside the application, date modified, size, whether it is a file or folder. How do I get these values into a javaFileListFlavor that Windows will understand? Also, I would need a way of returning the actual file data (which will be read from a remote server). The basic File class doesn't allow many of these things to be set.I know I tried the same thing - I'm not sure this can be done at all, it could be that this can't be done if the file doesn't already exist somewhere on the local file system.
Edited by: tjacobs01 on Feb 11, 2009 12:41 AM -
Hi all !
does anybody know if it's possible to do drag and drop of windows icons (like folders) into Java Frames or other containers ?
I'd like to write an application where the user can drag Windows folders inside a Frame/Container and collect Folder information (the path to the folder)
Is it possible to do it ?
Thanks a lot
FrancescoHi,
It is possible.
You can drag platform independent objects like folders, icons etc. from the native platform to your java app.
The Java-Object you need in this case is a
DataFlavour like
DataFlavor.stringFlavor // for text
DataFlavor.javaFileListFlavor // for folders
in the tutorial jacob has linked you find more about this.
Olek -
Activating Drag and Drop As window in jdevstudio1013
Dear All,
I'm using jdevstudio1013.I don't see Drag And Drop As Window below Component window.Instead I see Property Inspecter Window .
How to activate Drop And Drag As window?
With rgds,
ShrinawHi,
The project is set as a JSF project.
And yes, there are the following error messages in the console when trying to drop a method into the page. The create command button / link dialog appears, and after choosing an option, nothing happens.
2007.07.30. 9:34:39 oracle.javatools.logging.LogUtils log
WARNING: Exception in task oracle.bali.xml.model.XmlModel$4@ebad43 on model orac
le.jdevimpl.webapp.jsp.JspXmlModel@eefa28; txn name=internal txn
oracle.jdevimpl.webapp.model.content.dom.util.ModelDomUtil$InvalidArgumentXmlException: Body node is not valid location for inserting Messages element. Try inserting at another location in the document.
at oracle.jdevimpl.webapp.model.content.dom.util.ModelDomUtil._doInsertNodes(ModelDomUtil.java:1716)
at oracle.jdevimpl.webapp.model.content.dom.util.ModelDomUtil.doInsertNodes(ModelDomUtil.java:1599)
at oracle.jdevimpl.webapp.common.WebAppXmlModel.insertNodesImpl(WebAppXmlModel.java:124)
at oracle.bali.xml.model.XmlModel$4.performTask(XmlModel.java:1414)
at oracle.bali.xml.model.task.StandardTransactionTask.runThrowingXCE(StandardTransactionTask.java:167)
at oracle.bali.xml.model.XmlModel.insertNodes(XmlModel.java:1384)
at oracle.jdevimpl.webapp.editor.LayoutXmlView$1.performTask(LayoutXmlView.java:194)
at oracle.bali.xml.model.task.StandardTransactionTask.runThrowingXCE(StandardTransactionTask.java:167)
at oracle.jdevimpl.webapp.editor.LayoutXmlView.insertNodes(LayoutXmlView.java:181)
at oracle.bali.xml.model.AbstractModel$1.performTask(AbstractModel.java:466)
at oracle.bali.xml.model.task.StandardTransactionTask.runThrowingXCE(StandardTransactionTask.java:190)
at oracle.bali.xml.model.AbstractModel.insertXmlKey(AbstractModel.java:447)
at oracle.adfdtinternal.view.faces.addin.ADFBindingXmlContextListener$AddMessagesPostInsertionTask.performTask(ADFBindingXmlContextListener.java:227)
at oracle.bali.xml.model.task.StandardTransactionTask.runThrowingXCE(StandardTransactionTask.java:167)
at oracle.adfdtinternal.view.common.binding.operation.CreateOperation$1.
performTask(CreateOperation.java:170)
at oracle.bali.xml.model.task.StandardTransactionTask.runThrowingXCE(Sta
ndardTransactionTask.java:167)
at oracle.adfdtinternal.view.common.binding.operation.CreateOperation.apply(CreateOperation.java:147)
at oracle.bali.xml.model.datatransfer.operation.PerformOperationAction.actionPerformed(PerformOperationAction.java:39)
at oracle.bali.xml.share.ActionProxy.actionPerformed(ActionProxy.java:47)
at oracle.bali.xml.gui.swing.dnd.DropMenuInvoker$CleanupProxy.actionPerformed(DropMenuInvoker.java:235)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1849)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2169)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
at javax.swing.AbstractButton.doClick(AbstractButton.java:302)
at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:1000)
at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:1041)
at java.awt.Component.processMouseEvent(Component.java:5488)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3126)
at java.awt.Component.processEvent(Component.java:5253)
at java.awt.Container.processEvent(Container.java:1966)
at java.awt.Component.dispatchEventImpl(Component.java:3955)
at java.awt.Container.dispatchEventImpl(Container.java:2024)
at java.awt.Component.dispatchEvent(Component.java:3803)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4212)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3892)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3822)
at java.awt.Container.dispatchEventImpl(Container.java:2010)
at java.awt.Window.dispatchEventImpl(Window.java:1774)
at java.awt.Component.dispatchEvent(Component.java:3803)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
2007.07.30. 9:34:39 oracle.javatools.logging.LogUtils log
WARNING: Exception in task oracle.jdevimpl.webapp.editor.LayoutXmlView$1@bc1eb2
on model oracle.jdevimpl.webapp.editor.LayoutXmlView@18587fe; txn name=internal
txn (exception previously logged)
2007.07.30. 9:34:39 oracle.javatools.logging.LogUtils log
WARNING: Exception in task oracle.bali.xml.model.AbstractModel$1@833c98 on model
oracle.jdevimpl.webapp.editor.LayoutXmlView@18587fe; txn name=Insert Messages (exception previously logged)
2007.07.30. 9:34:39 oracle.javatools.logging.LogUtils log
WARNING: Exception in task oracle.adfdtinternal.view.faces.addin.ADFBindingXmlContextListener$AddMessagesPostInsertionTask@1ff5bf1 on model oracle.jdevimpl.webapp.editor.LayoutXmlView@18587fe; txn name=Add faces messages task (exception previously logged)
2007.07.30. 9:34:39 oracle.javatools.logging.LogUtils log
WARNING: Exception in task oracle.adfdtinternal.view.common.binding.operation.CreateOperation$1@1ed3ca7 on model oracle.jdevimpl.webapp.editor.LayoutXmlView@18587fe; txn name=Create ADF Command Button (exception previously logged)
oracle.jdevimpl.webapp.model.content.dom.util.ModelDomUtil$InvalidArgumentXmlException: Body node is not valid location for inserting Messages element. Try inserting at another location in the document.
at oracle.jdevimpl.webapp.model.content.dom.util.ModelDomUtil._doInsertNodes(ModelDomUtil.java:1716)
at oracle.jdevimpl.webapp.model.content.dom.util.ModelDomUtil.doInsertNodes(ModelDomUtil.java:1599)
at oracle.jdevimpl.webapp.common.WebAppXmlModel.insertNodesImpl(WebAppXm
lModel.java:124)
at oracle.bali.xml.model.XmlModel$4.performTask(XmlModel.java:1414)
at oracle.bali.xml.model.task.StandardTransactionTask.runThrowingXCE(StandardTransactionTask.java:167)
at oracle.bali.xml.model.XmlModel.insertNodes(XmlModel.java:1384)
at oracle.jdevimpl.webapp.editor.LayoutXmlView$1.performTask(LayoutXmlView.java:194)
at oracle.bali.xml.model.task.StandardTransactionTask.runThrowingXCE(StandardTransactionTask.java:167)
at oracle.jdevimpl.webapp.editor.LayoutXmlView.insertNodes(LayoutXmlView.java:181)
at oracle.bali.xml.model.AbstractModel$1.performTask(AbstractModel.java:466)
at oracle.bali.xml.model.task.StandardTransactionTask.runThrowingXCE(StandardTransactionTask.java:190)
at oracle.bali.xml.model.AbstractModel.insertXmlKey(AbstractModel.java:447)
at oracle.adfdtinternal.view.faces.addin.ADFBindingXmlContextListener$AddMessagesPostInsertionTask.performTask(ADFBindingXmlContextListener.java:227)
at oracle.bali.xml.model.task.StandardTransactionTask.runThrowingXCE(StandardTransactionTask.java:167)
at oracle.adfdtinternal.view.common.binding.operation.CreateOperation$1.performTask(CreateOperation.java:170)
at oracle.bali.xml.model.task.StandardTransactionTask.runThrowingXCE(StandardTransactionTask.java:167)
at oracle.adfdtinternal.view.common.binding.operation.CreateOperation.apply(CreateOperation.java:147)
at oracle.bali.xml.model.datatransfer.operation.PerformOperationAction.a
ctionPerformed(PerformOperationAction.java:39)
at oracle.bali.xml.share.ActionProxy.actionPerformed(ActionProxy.java:47)
at oracle.bali.xml.gui.swing.dnd.DropMenuInvoker$CleanupProxy.actionPerformed(DropMenuInvoker.java:235)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1849)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2169)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
.java:420)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
at javax.swing.AbstractButton.doClick(AbstractButton.java:302)
at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:1000)
at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:1041)
at java.awt.Component.processMouseEvent(Component.java:5488)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3126)
at java.awt.Component.processEvent(Component.java:5253)
at java.awt.Container.processEvent(Container.java:1966)
at java.awt.Component.dispatchEventImpl(Component.java:3955)
at java.awt.Container.dispatchEventImpl(Container.java:2024)
at java.awt.Component.dispatchEvent(Component.java:3803)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4212)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3892)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3822)
at java.awt.Container.dispatchEventImpl(Container.java:2010)
at java.awt.Window.dispatchEventImpl(Window.java:1774)
at java.awt.Component.dispatchEvent(Component.java:3803)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
Thanks,
Patrik
(PS.: Is it the right thread or should I start another one?) -
Cant drag and drop in windows 7
cant drag and drop in windows 7 with itunes
Same exact problem. Drag and drop is not working in any fashion. I cant drag files to the library or to the ipod.
Itunes 10.4 Windows 7 64
Any Help??!? -
Drag and Drop between Flex application
Hello,
Can we implement the Drag and Drop functionality between 2
FLEX applications?
Each flex application is in its own IE.
Thank you,
ThierryTo my knowledge you can't drag and drop anything between 2
windows in a browser using any technique in the way that you mean.
In other words, I don't think you can even do this in javascript
between 2 windows.
You can use LocalConnection to simulate this though, by
having the drag manager notify the other application when it leaves
the stage, so that when you reach the other application it will
start the drag effect again in that window. -
I can't drag and drop from windows explorer into my ipod on itunes. Any suggestions?
Hi,
I manage my music/podcast library on my Vista PC using windows explorer because I don't like how iTunes does it. Then today I can no longer drag and drop from explorer onto my iPod in iTunes all I get is a circle with a line through it meaning "iTunes says no." Any suggestions?
Ta.You will need to Sync your iPad and all Music/Albums Selected will transfer over from iTunes..
iOS: Syncing your data with iTunes
http://support.apple.com/kb/HT1386 -
Can't drag and drop files onto Applications in Dock since upgrading to 10.6
Ever since my wife upgraded her iMac (2 GHz, 2 gigs) to 10.6, she can no longer drag and drop files onto certain applications in her dock to open the file. She has to go into the application and go to "open file" or whatever.
For example, if she has a Word doc on her desktop, she cannot drag it onto the Word icon in her dock.
Any advice?You have many issues with your and your wife's machine(s). Everything you've posted works here. Reinstall Snow Leopard, repair permissions, and see if that fixes things.
-
Drag and drop in windows explor
Hi,
I cant for the life of me ind out if this is possible. Im thinking of buying a Zen Touch 20GB and want to know if it is possible to drag and drop music directly in Windows without additional software. If so, I just might buy it
greetings TwistIf you install the PlaysForSure firmware yes, otherwise you need to install another program for it to work.
-
Drag and Drop - Java -- other application
Hi,
I'm writing an application, which requires to transfer the content of textfields through Drag and Drop to any other application.
Basically this works, but in combination with some applications, e.g. Mozilla, it happens, that the DragSourceListener doesn't recognize, that the Drag and Drop - operation is finished.
Because of this I get an InvalidDnDOperationException, when I try to start a new Drag and Drop - operation.
Can anyone tell me, how to solve the problem?
thanks in advance
ChristophAnd I get the:
java.lang.NullPointerException
at oracle.jbo.uicli.jui.JUPanelBinding.bindUIControl(JUPanelBinding.java:808)
at empapppack.empframe.jbInit(empframe.java:116)
at empapppack.empframe.<init>(empframe.java:51)
at emppapppack.Application1.<init>(Application1.java:13)
at empapppack.Application1.main(Application1.java:50) -
Drag and Drop using Windows Explo
Hi, I have a Zen Touch 20GB with firmware upgraded to version 2..0. I understand that it is possible to drag and drop files using windows explorer to the mp3 player. However, whenever I try to copy a folder containing audio files I always get a error stating that I don't have the permission to copy the audio files. I am able to copy other non- music files well and I have administrati've rights. Is this problem due the fact that audio files must reside within the default Music folder within the mp3 player? Can anyone kindly help me on this issue? Thanks a lot.
yes but there must be a folder for music only ex:
----------------------------------explorer------------------------------------------------
file View edit tools HElp WINDOWS
FOLDER ... FOLDER.... FOLDER
hard.. dri'ves
C:ICON... D:ICON... OR... F:ZEN
OR.
OTher
.zen. ..pretend.. this ..is ..the ..icon
-subfolders
... - .MUSIC. ... .DATA. .ROOT.
.. you should
.. drag ur music into music \ data goes in\ and right here im guessing
\ data folder\ is were ur contacts are
and yah //Message Edited by kickenchicken on 07--2006 09:54 PM -
Can't drag and drop from Windows Explorer into iTunes 10
HI. I recently upgraded to iTunes 10 and now, it won't let me drag and drop files from Windows explorer into iTunes. Is there a setting I need to turn on to get this to work again? I am running Vista.
I might be wrong, but ...
I know Microsoft Office 2011 is Mountain Lion compatible. In fact, Microsoft released updates to it right around the time of Mountain Lion's release to assure compatibility.
I do not believe Microsoft Office 2008 is Mountain Lion compatible. -
AIR Drag and Drop between Windows
I cant seem to get a simple use case to work:
I have an AIR app that has two <mx:Window> built as separate MXML components, one is called DragSourceWindow the other DragTargetWindow. Inside the DragSourceWindow is a canvas that can be dragged out of the window and dropped into the DragTargetWindow.
Code:
Main AIR App: http://pastie.caboo.se/private/wxcsvvxglm7aabf3xqta
DragTargetWindow: http://pastie.caboo.se/private/ysgv3kpr6suiakutnvt4g
DragSourceWindow: http://pastie.caboo.se/private/yybaslwsfz12znygyjvva
SVN Repo: http://zclguialvgrid.googlecode.com/svn/trunk/examples/DragManagerIssue/
Inside each <mx:Window> are some trace messages to see what is going on:
1. When a DragManager.isDragging is true
2. When you drag into a drop target
3. When you drop an item into a drop target
However, once you drop the canvas into a window and mouseover it again the DragManager still thinks a drag is active.
I am using the release versions of FB and AIR.
What am I doing wrong?Nevermind, you can't use DragManager at all in AIR it seems if you leave a window. You have to directly use the NativeDragManager.
Strange because it seems like the DragManager singleton manages that for you -- but it doesn't. -
WindowedApplication/ Drag and drop in Windows OS
Hi,
I have AIR application which is running on Mac OS and Windows. This application is standard desktop application (WindowedApplication). I use there drag&drop for moving preview of images. My problem is if preview image is large (width > 200 or height > 200) then drag preview is not correctly visible. The dragged preview on left top corner is correct but in right bottom corrner is not visible. There is some transient.
On Mac OS is all ok only in Windows is this problem.Can somebody help me with it?If you install the PlaysForSure firmware yes, otherwise you need to install another program for it to work.
-
Adobe Flex 4 Drag and drop example in application
I have been looking at the following example:
http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf64595-7fed.html#WS2d b454920e96a9e51e63e3d11c0bf69084-7cee
The example works in web based flash project, but if I use the same code in a desktop AIR project image does not move to the mouse position. (this is obvilously after I have changed the Application container to a WindowedApplication container)
It seems to be due to the fact that the parent container stops receiving mouse move events while dragging. The image then moves to a position relative the where the mouse clicked inside the image.
I was hoping someone would be able to tell me what I am doing wrong?I've managed to solve the issue using event.localX instead.
Maybe you are looking for
-
I forgot my computer password, I am trying to install a program and I can't
Can somebody help me? I know my apple ID and password, but I forgot the password for my IMac. I am trying to install a new program and it is asking me for my password and do not remember it. the keychain is the problem and when I try to create one or
-
How planned delivery time effects delivery creation?
Dear All, Some time before, while placing order thro' CRM, we came across a typical error (hard error). "date (11/12/2011) lies afterthe end of validity calendar". we could not place order in CRM but in SAP we could create save the order despite of
-
HP Photosmart 7520 e-All-in-One Printer - WHEN i AM TRYING TO MAKE A COPY COPY OF AN A4 DOCUMENT WITH A4 PAPER INSTALLED. iT KEEPS PUTTING THROUGH A BLANK SHEET AND SAYING INCORRECT PAPER SIZE. HELP!! I HAVE CHECKED FOR UPDATED SOFTWARE ETC, CLEAN
-
Cisco SG300 HOSTP_flash_operation: fatal error during read operation!
I have 2 Cisco SG300-52P switches. Earlier this week, one of them started dropping connections and POE was not working on a couple of devices... I came in this morning to restart them when no one else was around. After restarting them, the trouble
-
Users can't add items to their agendas - Module errors
There was a server crash recently and now some users are getting errors when they try to connect or make any updates to their Calendar. Some of the errors that are getting displayed to a pop up box are: <P> "Module agenda fr.cpp label 4334"<br> "Modu