import java.awt.*;
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 CpPictureFieldDemo extends CpLcApplet
{

    public void init()
    {
        super.init();

        CpAttachments attachments;
        CpAttachmentsLayout layout;
        CpPictureFieldPanel socSecPanel, phonePanel, zipPanel, ipPanel, ccPanel;

        CpPanelLc panelLc = new CpPanelLc();
        setLc(panelLc);
        panelLc.setDrawOffscreen(true);
        panelLc.setBackground(Color.lightGray);

        panelLc.setLayout(layout = new CpAttachmentsLayout());

        ccPanel = new CpPictureFieldPanel("Credit Card Information", "####-####-####-#### exp. ##/##", "1234-1111-2222-3333 exp. 03/98");
        panelLc.add(ccPanel);
        attachments = new CpAttachments();
        layout.setAttachments(ccPanel, attachments);
        attachments.setLeftAttachment(75);
        attachments.setTopAttachment(10);
        attachments.setRightAttachment(CpAttachments.ATTACH_SELF, 250);
        attachments.setBottomAttachment(CpAttachments.ATTACH_SELF, 80);

        ipPanel = new CpPictureFieldPanel("IP Address", "###.###.###.###", "128.128.128.128");
        panelLc.add(ipPanel);
        attachments = new CpAttachments();
        layout.setAttachments(ipPanel, attachments);
        attachments.setLeftAttachment(CpAttachments.ATTACH_SIBLING, 15);
        attachments.setLeftSibling(ccPanel);
        attachments.setTopAttachment(CpAttachments.ATTACH_SIBLING_OPPOSITE, 0);
        attachments.setTopSibling(ccPanel);
        attachments.setBottomAttachment(CpAttachments.ATTACH_SIBLING_OPPOSITE, 0);
        attachments.setBottomSibling(ccPanel);
        attachments.setRightAttachment(CpAttachments.ATTACH_SELF, 140);

        zipPanel = new CpPictureFieldPanel("Zip Code", "#####-####", "80305-1234");
        panelLc.add(zipPanel);
        attachments = new CpAttachments();
        layout.setAttachments(zipPanel, attachments);
        attachments.setLeftAttachment(50);
        attachments.setRightAttachment(CpAttachments.ATTACH_SELF, 120);
        attachments.setBottomAttachment(CpAttachments.ATTACH_SELF, 80);
        attachments.setTopAttachment(CpAttachments.ATTACH_SIBLING, 20);
        attachments.setTopSibling(ccPanel);

        socSecPanel = new CpPictureFieldPanel("Social Security Number", "###-##-####", "565-84-2206");
        panelLc.add(socSecPanel);
        attachments = new CpAttachments();
        layout.setAttachments(socSecPanel, attachments);
        attachments.setLeftAttachment(CpAttachments.ATTACH_SIBLING, 10);
        attachments.setLeftSibling(zipPanel);
        attachments.setTopAttachment(CpAttachments.ATTACH_SIBLING_OPPOSITE, 0);
        attachments.setTopSibling(zipPanel);
        attachments.setRightAttachment(CpAttachments.ATTACH_SELF, 160);
        attachments.setBottomAttachment(CpAttachments.ATTACH_SELF, 80);

        phonePanel = new CpPictureFieldPanel("Phone Number", "(###) ###-####", "(303) 545-2172");
        panelLc.add(phonePanel);
        attachments = new CpAttachments();
        layout.setAttachments(phonePanel, attachments);
        attachments.setLeftAttachment(CpAttachments.ATTACH_SIBLING, 10);
        attachments.setLeftSibling(socSecPanel);
        attachments.setTopAttachment(CpAttachments.ATTACH_SIBLING_OPPOSITE, 0);
        attachments.setTopSibling(socSecPanel);
        attachments.setRightAttachment(CpAttachments.ATTACH_SELF, 150);
        attachments.setBottomAttachment(CpAttachments.ATTACH_SELF, 80);
    }
}

