if (dragSource instanceof SLabel) {  dropTarget.setText(((SLabel)dragSource).getText()); result = true; } container.add(new SLabel("Drag and Drop Action triggered from " + dragSource.getClass().getName())); return result; }  });  container.add(dragSource); container.add(normalField); container.add(dropTarget); container.add(dragLabel);
}); } resetPuzzle();   final SPanel puzzle = new SPanel(); final SGridLayout gridLayout = new SGridLayout(3,3); gridLayout.setBorder(1); puzzle.setLayout(gridLayout); for (int i = 0; i < dropIcons.length; i++) { puzzle.add(dropIcons[i]); }   final SPanel pieces = new SPanel(); final SBoxLayout boxLayout = new SBoxLayout(SBoxLayout.HORIZONTAL); boxLayout.setBorder(1); pieces.setLayout(boxLayout); for (int i = 0; i < dragIcons.length; i++) { pieces.add(dragIcons[i]); }  puzzleContainer.add(puzzle); puzzleContainer.add(pieces);  controlContainer.add(statusLabel); controlContainer.add(resetButton);  container.add(puzzleContainer); container.add(controlContainer);
    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;    }