Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

how to use drag and drop for command buttons  RSS feed

 
Rajasekhar MV
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all
i am doing an application of network simulator
using swing
i have 15 command buttons (with icons on them)on the left side of the form.
i have use drag and drop for these command buttons
and place them on the form and draw lines between any no. of buttons(many-to-many)
please someone help me with the code
thanks in advance
regards
Rajasekhar
 
Nigel Chou
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Drag�n Drop is not simple. You must use DragSource, DragGestureListener and DropTargetListener, etc in pachage java.awt.dnd. and java.awt.datatransfer.DataFlavor.
To make your button (button) be able to be DnD.

Lay a BackgroundPanel on the left side of the form. To make the panel be able to receive drop:
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!