Java 控件的多重填充

Java 控件的多重填充,java,japplet,Java,Japplet,我想使用GridBagLayout将控件填充到水平和中心。我试过使用 this.setLayout(new GridBagLayout()); GridBagConstraints m=new GridBagConstraints(); m.fill=GridBagConstraints.HORIZONTAL; m.anchor=GridBagConstraints.PAGE_START; m.ipady=20; m.weightx=0.5; m.weighty=0.001; add(pnlHe

我想使用GridBagLayout将控件填充到
水平
中心
。我试过使用

this.setLayout(new GridBagLayout());
GridBagConstraints m=new GridBagConstraints();
m.fill=GridBagConstraints.HORIZONTAL;
m.anchor=GridBagConstraints.PAGE_START;
m.ipady=20;
m.weightx=0.5;
m.weighty=0.001;
add(pnlHeader,m);
m.fill=GridBagConstraints.HORIZONTAL|GridBagConstraints.VERTICAL;
m.anchor=GridBagConstraints.PAGE_END;
m.gridx=0;
m.weighty=1.0;
add(pnlBody,m);
这就是我得到的

我希望所选区域填充到小程序中。请问如何将第二个面板填充到小程序中

使用

m.fill = GridBagConstraints.BOTH;

请将我的链接定位到
页面_START
LEFT
?。请问我该怎么做?这可能需要一个新的问题-在新的问题中,一定要描述你的目标(可能是图像),并包括