public class WindowView { Composite cmp = new Composite(); WindowView() { // ¶Ô´°Ìå½øÐгõʼ»¯µÄÉèÖà cmp.setFrm(new Frame("Îļþ¹¤¾ß")); // ÉèÖóߴç´óСλÖà ÑÕÉ« cmp.getFrm().setBounds((cmp.getWidth() - 550) / 2, (cmp.getHeight() - 600) / 2, 550, 600); cmp.getFrm().setLayout(null); cmp.getFrm().setBackground(new Color(204, 232, 207)); // ÏÔʾ´°Ìå cmp.getFrm().setVisible(true);
// Îı¾¿òÓû§ÊäÈë³õʼ»¯ÉèÖà cmp.setTf(new TextField("ÊäÈë·¾¶:")); cmp.getTf().setBounds(80, 80, 250, 25); // ×é¼þÌí¼Óµ½´°Ìå cmp.getFrm().add(cmp.getTf());
// Îı¾¿òÓû§ÊäÈë³õʼ»¯ÉèÖà cmp.setTfParameter1(new TextField("ǰ׺:")); cmp.getTfParameter1().setBounds(80, 40, 120, 25); // ×é¼þÌí¼Óµ½´°Ìå cmp.getFrm().add(cmp.getTfParameter1());
// Îı¾¿òÓû§ÊäÈë³õʼ»¯ÉèÖà cmp.setTfParameter2(new TextField("ºó׺:")); cmp.getTfParameter2().setBounds(210, 40, 120, 25); // ×é¼þÌí¼Óµ½´°Ìå cmp.getFrm().add(cmp.getTfParameter2());
// °´Å¥½øÐгõʼ»¯ÉèÖà cmp.setButton(new Button("Ð޸IJéѯ")); cmp.getButton().setBounds(380, 80, 50, 25); cmp.getFrm().add(cmp.getButton()); cmp.setOpenButton(new Button("´ò¿ª")); cmp.getOpenButton().setBounds(380, 40, 50, 25); cmp.getFrm().add(cmp.getOpenButton());
// »Ö¸´¿ò cmp.setRecover(new Button("»Ö¸´")); cmp.getRecover().setBounds(440, 40, 100, 65); cmp.getFrm().add(cmp.getRecover()); // ¶ÔÎı¾ÇøÓò½øÐгõʼ»¯ÉèÖà cmp.setTa(new TextArea()); cmp.getTa().setBounds(80, 130, 350, 400); cmp.getFrm().add(cmp.getTa());
// ³õʼ»¯¶Ô»°¿ò×é¼þ cmp.setDl(new Dialog(cmp.getFrm(), "´íÎóÐÅÏ¢Ìáʾ", true)); cmp.getDl().setLayout(null); cmp.getDl().setBounds((cmp.getWidth() - 500) / 2, (cmp.getHeight() - 150) / 2, 500, 150); // ³õʼ»¯¶Ô»°¿òÎı¾¿òÎı¾±êÇ© cmp.setLbl(new Label()); cmp.getLbl().setBounds(80, 40, 400, 40); cmp.getDl().add(cmp.getLbl()); //¶Ô»°¿ò Ìáʾ¿òÉϵİ´½¨ cmp.setDlbButton(new Button("¹Ø±Õ")); cmp.getDlbButton().setBounds(220, 100, 50, 25); cmp.getDl().add(cmp.getDlbButton()); // ×¢½ø¼àÌýÆ÷ new ListenImplement(cmp).myEvent(); } } |