import java.awt.FlowLayout;

import javax.swing.JPanel;


public class DragSourceHostPanel extends JPanel{
	
	public DragSourceHostPanel(){
		super();
		
		DragSourceLabel item1=new DragSourceLabel();
		item1.setText("apple");

		DragSourceLabel item2=new DragSourceLabel();
		item2.setText("orange");
		
		DragSourceLabel item3=new DragSourceLabel();
		item3.setText("lemon");
		
		setLayout(new FlowLayout());
		add(item1);
		add(item2);
		add(item3);
		
		// add listener to remove label when dropped into DropTargetPanel.
		DragSourceLabelListener l=new DragSourceLabelListener(){
			//@Override
			public void requestRemove(DragSourceLabel dsl) {
				remove(dsl);
				
				revalidate();
				repaint();
			}
		};
		item1.addListener(l);
		item2.addListener(l);
		item3.addListener(l);
		
	}

}

