public class FileDropBean extends Object implements Serializable
FileDrop
class that handles all the dirty work.
After instantiating the bean, add components as drop targets using the
addFileDropTarget(...)
method. If the component
is a Container
, then all elements contained within will be
marked as a drop target as well.
Using the FileDrop
technique manually in your code will give you more options.
I'm releasing this code into the Public Domain. Enjoy.
Original author: Robert Harder, rharder@usa.net
Modifier and Type | Field and Description |
---|---|
private EventListenerList |
listenerList |
Constructor and Description |
---|
FileDropBean()
Creates new FileDropBean
|
Modifier and Type | Method and Description |
---|---|
void |
addFileDropListener(FileDropListener listener)
Register a listener for
FileDropEvent s. |
void |
addFileDropTarget(Component comp)
Registers a component as a drop target.
|
protected void |
fireFileDropHappened(File[] files)
Fires a
FileDropEvent with the given non-null
list of dropped files. |
void |
removeFileDropListener(FileDropListener listener)
Unregister a listener for
FileDropEvent s. |
boolean |
removeFileDropTarget(Component comp)
Unregisters a component as a drop target.
|
private EventListenerList listenerList
public FileDropBean()
public void addFileDropTarget(Component comp)
comp
- The component to register as a drop targetpublic boolean removeFileDropTarget(Component comp)
comp
- The component to unregisterpublic void addFileDropListener(FileDropListener listener)
FileDropEvent
s.listener
- The listener to registerpublic void removeFileDropListener(FileDropListener listener)
FileDropEvent
s.listener
- The listener to unregisterprotected void fireFileDropHappened(File[] files)
FileDropEvent
with the given non-null
list of dropped files.files
- The files that were droppedWebARTS Library Licensed Under the GNU - General Public License. Other Libraries licensed under their respective Open Source Licenses