先将以下2句加上后再看看。gbc=new GridBagConstraints(); ////////
gbc.anchor=GridBagConstraints.NORTHWEST;
gbc.gridx=1;
gbc.gridy=5;gl=new GridBagLayout(); /////////
gl.setConstraints(labelAppID,gbc);
panel.add(labelAppID);
gbc.anchor=GridBagConstraints.NORTHWEST;
gbc.gridx=1;
gbc.gridy=5;gl=new GridBagLayout(); /////////
gl.setConstraints(labelAppID,gbc);
panel.add(labelAppID);
(1)下面两句没有初始化
GridBagLayout gl;
GridBagConstraints gbc;
(2)没有将布置 gl关联
(3)getContentPane().add(panel);应放在最后
(4)再不行的话,看浏览器的属性是否设置好。
<applet code=Applicant.class width=700 height=500></applet>
</html>这样试试.