日期:2014-05-20 浏览次数:20769 次
import java.awt.*; public class Sb{ public static void main(String[] args){ Frame f=new Frame(); f.setSize(300,300); f.setLayout(new GridLayout(2,1)); Panel p1=new Panel(); p1.setLayout(new BorderLayout()); Panel p1_1=new Panel(); p1_1.setLayout(new GridLayout(2,1)); Button bn1=new Button("sb1"); Button bn2=new Button("sb2"); Button bn3=new Button("sb3"); Button bn4=new Button("sb4"); p1.add(bn1,BorderLayout.WEST); p1_1.add(bn3); p1_1.add(bn4); p1.add(p1_1,BorderLayout.CENTER); p1.add(bn2,BorderLayout.EAST); f.add(p1); f.pack(); } }