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?
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?