如何在两个面板之间拖放形状 [英] How to drag and drop shape between two panels

查看:73
本文介绍了如何在两个面板之间拖放形状的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个面板,一个在左侧,其中包含在按钮上绘制的形状,另一个在左侧的主面板中,放置形状

I have two panel, one on the left, which contains my shapes drawn on buttons, and the main panel on the left, where I drop the shapes

我可以实现拖放吗?

已编辑

我正在使用的代码实际上会产生一个

this the code I'am using actually that produce a kind of a dragging

  public void mouseReleased(MouseEvent e) {

                    CreateShapeCommand Cmd= new CreateShapeCommand(shape);
                    Caretaker.getInstance().execute(Cmd.copy(e.getX(),e.getY()));   
                }


推荐答案

您应该熟悉一下教程

这篇关于如何在两个面板之间拖放形状的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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