Java中的拖放-绘制不仅仅是边框 [英] Drag and Drop in Java - Painting more than just a border

查看:96
本文介绍了Java中的拖放-绘制不仅仅是边框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个JTable和JList,并设置了代码,以便可以使用内置的Swing方法从JTable拖到JList.

I have a JTable and a JList and I have my code set up so that I can drag from the JTable to the JList using built in Swing methods.

当我从JTable拖动到JList时,被拖动的图像"只是我要拖动的东西的边框.具体来说,在源是JTable的情况下,图像只是我选择拖动的行的边框.

When I drag from the JTable to the JList, the "image" that is dragged is simply a border of the thing I am dragging. Specifically, in the case of the source being a JTable, the image is just a border of the row I selected to drag.

如何覆盖此图像"是什么?如何获取它以便用户可以拖动文本,而不仅仅是边框(矩形)?

How can I override what this "image" is? How can I get it so that the user can drag text, not just a border (rectangle)?

推荐答案

您可以签出

  • http://rabbit-hole.blogspot.com.au/2006/05/my-drag-image-is-better-than-yours.html
  • http://rabbit-hole.blogspot.com.au/2006/08/drop-target-navigation-or-you-drag.html
  • http://rabbit-hole.blogspot.com.au/2006/04/smooth-jlist-drop-target-animation.html
  • http://rabbit-hole.blogspot.com.au/2006/07/drag-images-for-everyoneand-we-do-mean.html

现在有些人可能跟你不太一样,但是他在拖曳n的情况下做了很多事情,要尽可能多地签出这是浪费的记录

Now some may not be quite what you after, but he's done so much with drag n drop, it'd be waste note to check out as much as you can

这篇关于Java中的拖放-绘制不仅仅是边框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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