问题
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
How can I implement a drag and drop ?
Edited
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()));
}
回答1:
You should get familiar with this tutorial.
来源:https://stackoverflow.com/questions/5474653/how-to-drag-and-drop-shape-between-two-panels