01: package net.xoetrope.samples.simple;
02:
03: import net.xoetrope.awt.XButton;
04: import net.xoetrope.awt.XEdit;
05: import net.xoetrope.awt.XPanel;
06: import net.xoetrope.xui.XPage;
07:
08: public class SimpleForm extends XPage {
09: XEdit txtFirstname, txtSurname, txtAge, txtCarCost, txtDeposit;
10: XPanel pnlClientInfo, pnlFinancialInfo, pnlButtons;
11: XButton btnOK, btnCancel;
12:
13: public SimpleForm() {
14: pnlClientInfo = (XPanel) componentFactory.addComponent(
15: XPage.PANEL, 10, 10, 180, 80);
16: pnlFinancialInfo = (XPanel) componentFactory.addComponent(
17: XPage.PANEL, 10, 100, 180, 60);
18: pnlButtons = (XPanel) componentFactory.addComponent(
19: XPage.PANEL, 10, 160, 180, 80);
20: componentFactory.setParentComponent(pnlClientInfo);
21: componentFactory.addComponent(XPage.LABEL, 0, 10, 90, 20,
22: "Firstname:");
23: txtFirstname = (XEdit) componentFactory.addComponent(
24: XPage.EDIT, 100, 10, 100, 20);
25: componentFactory.addComponent(XPage.LABEL, 0, 30, 90, 20,
26: "Surname:");
27: txtSurname = (XEdit) componentFactory.addComponent(XPage.EDIT,
28: 100, 30, 100, 20);
29: componentFactory.addComponent(XPage.LABEL, 0, 50, 90, 20,
30: "Age:");
31: txtAge = (XEdit) componentFactory.addComponent(XPage.EDIT, 100,
32: 50, 100, 20);
33:
34: componentFactory.setParentComponent(pnlFinancialInfo);
35: componentFactory.addComponent(XPage.LABEL, 0, 10, 90, 20,
36: "Car cost:");
37: txtCarCost = (XEdit) componentFactory.addComponent(XPage.EDIT,
38: 100, 10, 100, 20);
39: componentFactory.addComponent(XPage.LABEL, 0, 30, 90, 20,
40: "Deposit:");
41: txtDeposit = (XEdit) componentFactory.addComponent(XPage.EDIT,
42: 100, 30, 100, 20);
43:
44: componentFactory.setParentComponent(pnlButtons);
45: btnOK = (XButton) componentFactory.addComponent(XPage.BUTTON,
46: 40, 30, 60, 20, "Proceed");
47: btnCancel = (XButton) componentFactory.addComponent(
48: XPage.BUTTON, 110, 30, 60, 20, "Cancel");
49: }
50: }
|