布局管理器—FlowLayout
/**?* @(#)TestFlowLayout.java
?*
?* TestFlowLayout application
?*
?* @author
?* @version 1.00 2007/1/21
?*/
?import java.awt.*;
?import java.awt.event.*;
public class TestFlowLayout extends Frame
?{
??? public void init()
?{
??add(new Button("第一個"));
??add(new Button("第二個"));
??add(new Button("第三個"));
??add(new Button("第四個"));
?}
??? public TestFlowLayout()
??? {
??? ?FlowLayout fl=new FlowLayout();
??? ?setLayout(fl);
??? ?init();
??? ?addWindowListener(new WindowAdapter()
??? ?{
??? ??public void windowClosing(WindowEvent e)
??? ??{
??? ???e.getWindow().dispose();
??? ??}
??? ?});
??? }
??? public static void main(String[] args)
??? {
??? ?System.out.println("Hello World!");
??? ?TestFlowLayout mainFram=new TestFlowLayout();
??? ?mainFram.setTitle("TestBorderLayout");
??? ?mainFram.setBounds(300,200,400,400);
??? ?mainFram.setVisible(true);
??? }
}
posted on 2007-01-21 11:13 大頭劍客 閱讀(158) 評論(0) 編輯 收藏 所屬分類: 學習筆記