import waba.ui.*; public class ContactManager extends MainWindow{ TabPanel tabpanel; Contacts contacts; ContactManager(){ setTitle("ContactManager"); } public void onStart() { String tabs[] = new String[]{"Contacts","Prospects"}; tabpanel = new TabPanel(tabs); tabpanel.setRect(0, 15, this.width, this.height); tabpanel.setGaps(2,2,2,2); contacts = new Contacts(); contacts.setRect(10,10,160,110); tabpanel.getPanel(0).add(contacts); add(tabpanel); } public void onEvent(Event event){ if (event.type == ControlEvent.PRESSED && event.target == tabpanel) { if (tabpanel.getActiveTab() == 0);// 保存联络信息else;} } } class Contacts extends Container{ Label lblName = new Label("Name"); Edit edtName = new Edit(); Label lblAddr = new Label("Address"); Edit edtAddr = new Edit(); Label lblEmail = new Label("email"); Edit edtEmail = new Edit(); Button button = new Button ("OK"); public Contacts() { lblName.setRect(10,10,60,12); edtName.setRect(10,22,90,12); lblEmail.setRect(10,34,60,12); edtEmail.setRect(10,46,90,12); lblAddr.setRect(10,58,60,12); edtAddr.setRect(10,70,90,12); button.setRect(10,90, 30,12); add(lblName);add(edtName); add(lblEmail); add(edtEmail); add(lblAddr); add(edtAddr); add(button); } } |
欢迎光临 电子技术论坛_中国专业的电子工程师学习交流社区-中电网技术论坛 (http://bbs.eccn.com/) | Powered by Discuz! 7.0.0 |