PDA

View Full Version : Java - Drag n Drop to/from JPanels


Yakisoba
08-18-2006, 07:43 AM
is it possible to Drag and Drop a shape (say a rectangle) from one JPanel(A) to another JPanel (B)?

Just started diving into GUI development and java.awt.dnd.

Currently I have a JFrame with three JPanels (A, B, C)...
In JPanel "A" I have drawn a rectangle.
I am working toward having the ability to drag and drop the rectangle among the different JPanels.

Any suggestions would be greatly appreciated.

Thanks,

Yak

Kura_kai
08-18-2006, 02:34 PM
How are the Panels layed out exactlly? Multiple windows? All in one window and can see all ofthem? Or do you have a tab thingy so you can switch between panels?

Yakisoba
08-21-2006, 04:02 AM
Sorry. A detail I should have provided...

One JFrame
3 JPanels side-by-side inside the JFrame


Yak