标签:mic south 布局管理 tla col put bsp 五个 learning
BorderLayout 将容器分为EAST, SOUTH, WEST,NORTH,CENTER五个区域。
public class BorderLayoutTest { public static void main(String[] args) { var f = new Frame("BorderLayout"); f.setLayout(new BorderLayout()); f.add(new Button("south"), BorderLayout.SOUTH); f.add(new Button("north"), BorderLayout.NORTH); f.add(new Button("center")); f.add(new Button("west"),BorderLayout.WEST); f.add(new Button("east"),BorderLayout.EAST); f.pack(); f.setVisible(true); } }
output:
learning java AWT 布局管理器BorderLayout
标签:mic south 布局管理 tla col put bsp 五个 learning
原文地址:https://www.cnblogs.com/lianghong881018/p/11268302.html