API能过时么
好几个程序都出现这样的结果,是怎么回事啊?各位指教
源程序如下:
import java.awt.*;
class StudentInfoFrame extends Frame{
Label lSno=new Label("学号:");
TextField tfSno=new TextField(8);
Label lSname=new Label("姓名:");
TextField tfSname=new TextField(8);
CheckboxGroup sex=new CheckboxGroup();
Checkbox male=new Checkbox("男",sex);
Checkbox female=new Checkbox("女",sex);
Checkbox isCardre=new Checkbox("是否干部");
Choice deptName=new Choice();
StudentInfoFrame(String title){
super(title);
this.setSize(100,100);
this.setLocation(200,300);
this.setLayout(new FlowLayout());
this.add(lSno);
this.add(tfSno);
this.add(lSname);
this.add(tfSname);
this.add(male);
this.add(female);
this.add(isCardre);
deptName.add("");
this.add(deptName);
}
public static void main(String args[]){
StudentInfoFrame f=new StudentInfoFrame ("studentInfo");
f.setLocation(100,100);
f.show();
}
}
[此贴子已经被作者于2006-4-20 10:47:27编辑过]