本帖最后由 寇龙飞 于 2012-9-15 10:58 编辑
- package com.itheima.bixiangdong;
- import java.awt.Button;
- import java.awt.FlowLayout;
- import java.awt.Frame;
- import java.awt.event.WindowAdapter;
- import java.awt.event.WindowEvent;
- import java.awt.event.WindowListener;
- public class MyLayout {
- public static void main(String[] args) {
- Frame f = new Frame("awt");
- f.setLocation(300, 300);
- f.setSize(500, 300);
- f.setLayout(new FlowLayout());
-
- f.addWindowListener(new MyWin());
- f.setVisible(true);
- }
- }
- class MyWin extends WindowAdapter {
- void windowCloseing(WindowEvent e) {
- System.exit(0);
- }
- }
复制代码 |
|