tailieunhanh - Lập trình đồ họa với AWT - Phần 5

Quản lý trình bày Layout manager: quản lý cách trình bày của các GUI components trong một Container Các layout manager FlowLayout BorderLayout CardLayout GridLayout GridBagLayout Sử dụng phương thức setLayout() của một Container để thay đổi layout | Quảnlý trình bày Layout manager quản lý cách trình bày của các GUI components trong một Container Các layout manager FlowLayout BorderLayout CardLayout GridLayout GridBagLayout Sử dụng phương thức setLayout của một Container để thay đôi layout 82 Quảnlý trình bày FlowLayout Là layout mặc định cho Applet và Panel Các thành phần được sắp xếp từ trái sang phải trên xuống dưới Các hàm khởi tạo FlowLayout FlowLayout int alignment Alignment có thể là LEFT RIGHT FlowLayout int int int 83 Quảnlý trình bày FlowLayout import . import . public class FlowLayoutTest extends Frame implements WindowListener public FlowLayoutTest String title super title addWindowListener this setLayout new FlowLayout 20 50 for int i 1 i 15 i add new Button Button i setSize 575 300 setVisible true public void windowClosing WindowEvent e dispose 0 .