Drag & Drop functionality for JAVA GUI components
obj = dndcontrol(javaobj) creates a dndcontrol object for the specified Java object, such as 'javax.swing.JTextArea' or 'javax.swing.JList'. Two callback functions are available: obj.DropFileFcn and obj.DropStringFcn, that listen to drop actions of respectively system files or plain text.
The Drag & Drop control class relies on a Java class "MLDropTarget.class" that need to be visible on the Java classpath. To initialize, call the static method dndcontrol.initJava(). The Java class can be adjusted and recompiled if desired.
A demonstration is available from the static method dndcontrol.demo().
Example:
dndcontrol.initJava();
dndcontrol.demo();
Written by: Maarten van der Seijs, 2015.
Citation pour cette source
Maarten van der Seijs (2026). Drag & Drop functionality for JAVA GUI components (https://fr.mathworks.com/matlabcentral/fileexchange/53511-drag-drop-functionality-for-java-gui-components), MATLAB Central File Exchange. Extrait(e) le .
Compatibilité avec les versions de MATLAB
Plateformes compatibles
Windows macOS LinuxTags
Remerciements
Inspiré par : UICOMPONENT - expands uicontrol to all Java classes
A inspiré : DropListener, MATLAB version of ImageJ
Découvrir Live Editor
Créez des scripts avec du code, des résultats et du texte formaté dans un même document exécutable.
| Version | Publié le | Notes de version | |
|---|---|---|---|
| 1.0.0.0 |
