Java - 可视地拖动一个swing元素 [英] Java - visually drag a swing element

查看:146
本文介绍了Java - 可视地拖动一个swing元素的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有类似的解决方案 http: //allen-sauer.com/com.allen_sauer.gwt.dnd.demo.DragDropDemo/DragDropDemo.html#PaletteExample ,但是对于普通的Java应用程序,即允许gui元素在画布上拖动?

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?

谢谢

推荐答案

是的,这是可能的。不,这不是微不足道的。

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

你会想要使用代码D'n'D API 如何使用Java 2第1部分拖放

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

您可能想要阅读

  • 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

您可能还需要熟悉 GlassPane

You may also want to become familiar with the GlassPane

这篇关于Java - 可视地拖动一个swing元素的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆