Java - visually drag a swing element

╄→гoц情女王★ 提交于 2019-12-30 07:48:22

问题


Is there a similar solution to http://allen-sauer.com/com.allen_sauer.gwt.dnd.demo.DragDropDemo/DragDropDemo.html#PaletteExample but for normal Java applications, i.e. allowing gui elements to be dragged around on a canvas?

Thanks


回答1:


Yes, it's possible. No it's not trivial.

You'll want to become farmiluar with the code D'n'D API How to drag and drop with Java 2, Part 1

You may like to have a read through

  • Smooth JList Drop Target Animation
  • Smooth Tree Drop Animation
  • My Drag Image is Better Than Yours
  • Dead Simple Drags
  • Fancy Drops
  • Drag Images for Everyone...and we do mean Everyone
  • Drop Target Navigation, or You Drag Your Bags
  • Swing Drag Images, Improved
  • Improved Drag Images

You may also want to become familiar with the GlassPane



来源:https://stackoverflow.com/questions/13387086/java-visually-drag-a-swing-element

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!