[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Newsgroup Home]
|
[news.eclipse.platform.swt] Re: problem about SWT drag and drop
|
- From: duongn@xxxxxxxxxx (Duong Nguyen)
- Date: Tue, 6 May 2008 22:36:16 +0000 (UTC)
- Newsgroups: eclipse.platform.swt
- Organization: Eclipse
- User-agent: NewsPortal/0.36 (http://florian-amrhein.de/newsportal)
There were a couple of problems with this code that you need to fix to
make it work.
1) You need to change the condition in the dragFinished code from OR (||)
to AND (&&) otherwise the character is removed even when the drop failed.
public void dragFinished(DragSourceEvent event) {
// Removes the text after the move operation.
if (event.doit == true && event.detail == DND.DROP_MOVE) {
label.setText("");
}
}
2) You need to set the drop target for the bottom row by uncommenting the
line:
setDropTarget(labelRowTwo);
Hopefully, you can unscramble the mystery word after that. :-)