I am extending the JComponent and making my own component.
I wan't this component to be dragged. How can I do that? To be more specific I am supposed to create a Toolbar and this component on it. I wan't it to be dragged to another panel and have an instance of it there.
Can you suggest some suitable ways for this? What APIs shall be helpful?
Any kind of help is appreciated.
"Thinking of doing something is also doing something ...so don't just stop thinking!"
There are a number of ways to do this. Working with the Drag and Drop trail in the java tutorial is one way. You could add your mouse listeners directly to the JToolBar components and to the target drop panel(s). You could use a glass pane or an OverlayLayout with a non–opaque top panel for your mouse listeners. This example app uses the last option.
Thank you my well lotioned goddess! Here, have my favorite tiny ad!
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop