import waba.ui.*; import waba.fx.*; public class HelloWaba extends MainWindow { Button closeButton; public HelloWaba() { Title title = new Title("HelloWaba"); title.setRect(0, 0, this.width, 15); add(title); closeButton = new Button("Close"); closeButton.setRect(0, this.height - 15, 44, 15); add(closeButton); } public void onEvent(Event event) { if (event.type == ControlEvent.PRESSED) { if (event.target == closeButton) exit(0); } } } |
欢迎光临 电子技术论坛_中国专业的电子工程师学习交流社区-中电网技术论坛 (http://bbs.eccn.com/) | Powered by Discuz! 7.0.0 |