如何找到,如果图像被点击JApplet的? [英] How to find if image is clicked in JApplet?

查看:147
本文介绍了如何找到,如果图像被点击JApplet的?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是支持图像拖动。如何找到,如果被点击 JApplet的

It is to support image dragging. How to find if an image is clicked in JApplet?

我敢肯定有一个简单的方法来做到这一点,但我到处找,似乎无法找到它。

I'm sure there is an easy way to do this, but I've looked everywhere and cannot seem to find it.

推荐答案

查看的拖放和数据传输的教程的教训。

See the Drag and Drop and Data Transfer lesson of the tutorial.

如果拖动的目的是改变顺序幻灯片或类似的,看一个的 JList的 。请参见 setDragEnabled(真) &安培; 如何使用列表,获取更多详情。

If the purpose of the dragging is to change the order in a slideshow or similar, look to a JList. See setDragEnabled(true) & How to Use Lists for more details.

有关的显示部分,我会建议的JLabel 按@Hover的建议。 JList的使用的JLabel 作为默认渲染组件。

For the display component, I would recommend a JLabel as suggested by @Hover. JList uses a JLabel as the rendering component by default.

这篇关于如何找到,如果图像被点击JApplet的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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