import java.awt.*;
import java.applet.*;
import java.util.*;
import cnp.ew.text.*;
import cnp.ew.spin.*;
import cnp.ew.util.*;
import cnp.ew.layout.*;
import cnp.ew.image.*;
import cnp.ew.misc.*;
import cnp.ew.lightweight.*;
import cnp.ew.kdemo.*;

public class CpSpinButtonDemo extends CpLcApplet
{
    public void init()
    {
        super.init();

        CpAttachments attachments;
        CpAttachmentsLayout layout;
        CpSpinEditorPanel dateSpinPanel, timeSpinPanel, integerSpinPanel, stringSpinPanel;

        CpPanelLc panelLc = new CpPanelLc();
        setLc(panelLc);
        panelLc.setDrawOffscreen(true);
        panelLc.setBackground(Color.lightGray);
        panelLc.setLayout(layout = new CpAttachmentsLayout());

        dateSpinPanel = new CpSpinEditorPanel("", new CpDateSpinEditorLc(), new Date(), "dddd, mmmm d, yyyy");
        panelLc.add(dateSpinPanel);
        attachments = new CpAttachments(10, 10, 10, -1);
        attachments.setBottomAttachment(CpAttachments.ATTACH_SELF, 40);
        layout.setAttachments(dateSpinPanel, attachments);

        timeSpinPanel = new CpSpinEditorPanel("", new CpTimeSpinEditorLc(), new Date(), "h:nn AM/PM");
        panelLc.add(timeSpinPanel);
        attachments = new CpAttachments();
        layout.setAttachments(timeSpinPanel, attachments);
        attachments.setLeftAttachment(10);
        attachments.setTopAttachment(10, dateSpinPanel);
        attachments.setRightAttachment(10);
        attachments.setBottomAttachment(CpAttachments.ATTACH_SELF, 40);


        integerSpinPanel = new CpSpinEditorPanel("", new CpIntegerSpinEditorLc(), new Integer(33), "#,###.00");
        panelLc.add(integerSpinPanel);
        attachments = new CpAttachments();
        layout.setAttachments(integerSpinPanel, attachments);
        attachments.setLeftAttachment(10);
        attachments.setTopAttachment(10, timeSpinPanel);
        attachments.setRightAttachment(10);
        attachments.setBottomAttachment(CpAttachments.ATTACH_SELF, 40);


        CpStringListSpinEditorLc spinEditor = new CpStringListSpinEditorLc();
        Vector list = new Vector();
	    list.addElement("Tiger Shark");
	    list.addElement("Manta Ray");
	    list.addElement("Potato Cod");
	    list.addElement("Crocodile");
        spinEditor.setStringList(list);
        stringSpinPanel = new CpSpinEditorPanel("", spinEditor, "Manta Ray", "");
        panelLc.add(stringSpinPanel);
        attachments = new CpAttachments();
        layout.setAttachments(stringSpinPanel, attachments);
        attachments.setLeftAttachment(10);
        attachments.setTopAttachment(10, integerSpinPanel);
        attachments.setRightAttachment(10);
        attachments.setBottomAttachment(CpAttachments.ATTACH_SELF, 40);
    }
}







