Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Drag&Drop from one JInternalFrame to another?

Status
Not open for further replies.

borbjo

Programmer
Mar 29, 2002
33
NO
This question has been asked a lot in the Java forums, but I have yet to see an solution to this particular problem.

I have a JDesktopPane with two JInternalFrames. One is the 'editor window / working surface' while the other is a toolbar with icons on it.

The idea is that the user may drag and drop an icon from the toolbar and onto the working surface.

The problem is that the toolbar needs to be selected for the d'n'd to be initiated. So, when the user is working in the main editor (using his mouse) and then decides to drag an icon from the toolbar it doesn't work the first time - becuase the toolbar didn't have focus.

My first fix was to requestFocus() when the mouse moved above the toolbar, but this does not work properly.

Any ideas?
 
It's just a custom JComponent inside a JInternalFrame (a 'view').
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top