public boolean handleDrop(SComponent dragSource) { boolean result = false; if (dragSource instanceof STextComponent) {  dropTarget.setText(((STextComponent)dragSource).getText()); result = true;
public boolean handleDrop(SComponent dragSource) { if (dragIcons[position].equals(dragSource)) { dragIcons[position].setIcon(null); beeIcons[position].setIconHeight(100); beeIcons[position].setIconWidth(100); dropIcon.setIcon(beeIcons[position]); piecesRight++; if (piecesRight == 9) { statusLabel.setText("Look, it's got wingS ;) !"); statusLabel.setAttribute(CSSProperty.FONT_WEIGHT, "600"); statusLabel.setAttribute(CSSProperty.COLOR, "red"); } else { statusLabel.setText("You have " + piecesRight + " pieces right! Can you guess what it is?"); } return true; } statusLabel.setText("That piece doesn't belong there! What are you thinking?"); return false;
    protected SComponent createExample() {        final SPanel container = new SPanel();        container.setLayout(new SBoxLayout(SBoxLayout.VERTICAL));        // initialize the drag and drop components        dragSource.setDragEnabled(true);        dragLabel.setDragEnabled(true);        // for dropTargets, adding a Listener is enough        dropTarget.addComponentDropListener(new SComponentDropListener() {            public boolean handleDrop(SComponent dragSource) {                boolean result = false;                if (dragSource instanceof STextComponent) {                    // allow drop                    dropTarget.setText(((STextComponent)dragSource).getText());                    result = true;                }                if (dragSource instanceof SLabel) {                    // allow drop                    dropTarget.setText(((SLabel)dragSource).getText());                    result = true;                }                container.add(new SLabel("Drag and Drop Action triggered from " + dragSource.getClass().getName()));                return result;            }                    });        // add the components to the container        container.add(dragSource);        container.add(normalField);        container.add(dropTarget);        container.add(dragLabel);                return container;    }