错误:java.awt.dnd.InvalidDnDOperationException: Drag and drop in progress
at sun.awt.dnd.SunDragSourceContextPeer.setDragDropInProgress(SunDragSourceContextPeer.java:298)
at java.awt.dnd.DragSource.startDrag(DragSource.java:286)
at java.awt.dnd.DragSource.startDrag(DragSource.java:403)
at com.umost.sa.client.sys.configmanage.orgnizationconfig.TreeDragSource.dragGestureRecognized(TreeDragSource.java:80)
at java.awt.dnd.DragGestureRecognizer.fireDragGestureRecognized(DragGestureRecognizer.java:339)
at sun.awt.windows.WMouseDragGestureRecognizer.mouseDragged(WMouseDragGestureRecognizer.java:202)
at java.awt.AWTEventMulticaster.mouseDragged(AWTEventMulticaster.java:262)
at java.awt.AWTEventMulticaster.mouseDragged(AWTEventMulticaster.java:261)
at java.awt.AWTEventMulticaster.mouseDragged(AWTEventMulticaster.java:261)
at java.awt.AWTEventMulticaster.mouseDragged(AWTEventMulticaster.java:261)
at java.awt.Component.processMouseMotionEvent(Component.java:5536)
at javax.swing.JComponent.processMouseMotionEvent(JComponent.java:3144)
at java.awt.Component.processEvent(Component.java:5257)
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:3909)
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)
代码片段:
public void dragGestureRecognized(DragGestureEvent dge) {
DefaultMutableTreeNode node = sourceTree.getSelectedNode();
System.out.println(node.getUserObject());
TreePath path = sourceTree.getSelectionPath();
transferable = new TransferableTreeNode1(node);
try {
source.startDrag(dge, DragSource.DefaultMoveDrop, transferable, this);出错的地方
} catch (Exception e) {
e.printStackTrace();
}
}请各位达人们帮帮忙吧,多谢多谢
at sun.awt.dnd.SunDragSourceContextPeer.setDragDropInProgress(SunDragSourceContextPeer.java:298)
at java.awt.dnd.DragSource.startDrag(DragSource.java:286)
at java.awt.dnd.DragSource.startDrag(DragSource.java:403)
at com.umost.sa.client.sys.configmanage.orgnizationconfig.TreeDragSource.dragGestureRecognized(TreeDragSource.java:80)
at java.awt.dnd.DragGestureRecognizer.fireDragGestureRecognized(DragGestureRecognizer.java:339)
at sun.awt.windows.WMouseDragGestureRecognizer.mouseDragged(WMouseDragGestureRecognizer.java:202)
at java.awt.AWTEventMulticaster.mouseDragged(AWTEventMulticaster.java:262)
at java.awt.AWTEventMulticaster.mouseDragged(AWTEventMulticaster.java:261)
at java.awt.AWTEventMulticaster.mouseDragged(AWTEventMulticaster.java:261)
at java.awt.AWTEventMulticaster.mouseDragged(AWTEventMulticaster.java:261)
at java.awt.Component.processMouseMotionEvent(Component.java:5536)
at javax.swing.JComponent.processMouseMotionEvent(JComponent.java:3144)
at java.awt.Component.processEvent(Component.java:5257)
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:3909)
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)
代码片段:
public void dragGestureRecognized(DragGestureEvent dge) {
DefaultMutableTreeNode node = sourceTree.getSelectedNode();
System.out.println(node.getUserObject());
TreePath path = sourceTree.getSelectionPath();
transferable = new TransferableTreeNode1(node);
try {
source.startDrag(dge, DragSource.DefaultMoveDrop, transferable, this);出错的地方
} catch (Exception e) {
e.printStackTrace();
}
}请各位达人们帮帮忙吧,多谢多谢
解决方案 »
- 发现最近问题很多,这次是关于反射API的 。
- 请问怎样给对象动态命名啊
- java事件处理如何将单击鼠标获得值添加到文本框
- 极难:如何得到从1582年10月15日0点0分UTC开始到现在的百纳秒数?
- java窗口程序可以调用ejb中的方法吗
- 给个对线程过多的处理例子,在线等!
- 在java1.4+mySql中,如何把一个类存储到数据库中,并读回?
- 有没有什么类或者什么方法将中文转换成....,例如"我们",转换以后UNICODE码是"\u6211\u4EEC"
- 如何使用另个class中的方法?
- 请高手指教
- public static void main(String args[]) 里有点不解
- 图片缩放失真问题
http://www.javaworld.com.tw/jute/post/view?bid=5&id=57921&age=0