import java.awt.*;
public class BoderLayoutDemo {
public static void main(String[] args) {
Frame f = new Frame("BorderLayout Sample");
f.setLayout(new BorderLayout());
Button north = new Button("North");
Button south = new Button("South");
Button west = new Button("West");
Button east = new Button("East");
Button center = new Button("Center");
f.add(north,BorderLayout.NORTH);
f.add(south,BorderLayout.SOUTH);
f.add(west,BorderLayout.WEST);
f.add(east,BorderLayout.EAST);
f.add(center,BorderLayout.CENTER);
f.setSize(400,400);
f.setVisible(true);
}
}
3月16日,BoderLayoutDemo,每日20行。
最新推荐文章于 2024-01-01 18:29:10 发布