直接编码模式(不推荐)inside the applet:
setLayout(null); //Default is BorderLayout
add(jpanel1); add(jpanel2); add(jpanel3);
Dimension d=getSize();
jpanel1.setBounds(0,0,widthYouNeed,heightYouNeed);
jpanel2.setBounds(widthYouNeed+spacing,0,d.width-widthYouNeed-spacing,heightYouNeed);
jpanel3.setBounds(0,heightYouNeed+spacing,d.width,d.height-heightYouNeed-spacing);另:
GridBagLayout needs a GrigBagConstraints c to resize the comps,
c.gridx,c.gridxy,c.fill..... see java.awt.GridBag*add(comp,c);