Berichten met label drag and drop

Drag and drop feedback

Ever since applications started to use drag and drop, I have been puzzled by the lack of feedback they provide for actually figuring out where you can drop the things you’ve picked up. Time and again, this reminds me of the first graphics adventures, like Maniac Mansion, where you spent hours hovering your cursor over images on the screen in an attempt to find these magic zones that actually did something. Adventures have since moved on to more advanced puzzles, but it’s amazing to see in ’serious’ applications, the drag and drop behaviour has not improved much.

That lead me to come up with a prototype of a drag and drop application that provides you with feedback about where you can drop your items as soon as you start dragging them. This way, you don’t need to hover your mouse over all elements to see if the mouse shape changes. Instead, using the timing framework, drop zones are animated onto the glass pane to indicate where you can drop the object.

Screenshot of the feedback in action

Technically, this is done by iterating over the content of a window hierarchically. As soon as a zone is identified that is a drop zone, it is marked as such. When all zones have been discovered, they are all highlighted, in this example with a simple rectangle, but you could enhance the example to create effects similar to Apple’s Exposé.

The application was developed for Java 6 and includes source code, build files and the necessary library.

Download: swing-dropzones.jar

, , ,

Nog geen reacties