主题:初学者请大虾帮忙...
package telephone_save;
import java.awt.*;
import javax.swing.*;
import java.awt.Rectangle;
class xiangxi extends Frame{
Panel apa;
Panel apa1;
Panel apa2;
Panel apab;
Label albname;
Label albsex;
Label albtel;
Label albsale;
Label albdin;
TextField atfname;
TextField atfsex;
TextField atftel;
TextField atfsale;
TextField atfdin;
public xiangxi(String s){
super(s);
Button b = new Button("确定提交");
setLayout(null);
apa.setLayout(new GridLayout(1,2));
apab.add(b);
apa1.setLayout(new GridLayout(5, 1));
apa2.setLayout(new GridLayout(5, 1));
apa1.add(albname);
apa1.add(albsex);
apa1.add(albtel);
apa1.add(albsale);
apa1.add(albdin);
apa2.add(atfname);
apa2.add(atfsex);
apa2.add(atftel);
apa2.add(atfsale);
apa2.add(atfdin);
apa.add(apa1);
apa.add(apa2);
add(apa);
add(apab);
apa.setSize(400, 220);
apa1.setSize(200, 220);
apa2.setSize(200, 220);
}
public static void main(String args[])
{
new xiangxi("详细信息输入");
}
}
说有java.lang.NullPointerException异常///
什么原因啊?
谢谢!
import java.awt.*;
import javax.swing.*;
import java.awt.Rectangle;
class xiangxi extends Frame{
Panel apa;
Panel apa1;
Panel apa2;
Panel apab;
Label albname;
Label albsex;
Label albtel;
Label albsale;
Label albdin;
TextField atfname;
TextField atfsex;
TextField atftel;
TextField atfsale;
TextField atfdin;
public xiangxi(String s){
super(s);
Button b = new Button("确定提交");
setLayout(null);
apa.setLayout(new GridLayout(1,2));
apab.add(b);
apa1.setLayout(new GridLayout(5, 1));
apa2.setLayout(new GridLayout(5, 1));
apa1.add(albname);
apa1.add(albsex);
apa1.add(albtel);
apa1.add(albsale);
apa1.add(albdin);
apa2.add(atfname);
apa2.add(atfsex);
apa2.add(atftel);
apa2.add(atfsale);
apa2.add(atfdin);
apa.add(apa1);
apa.add(apa2);
add(apa);
add(apab);
apa.setSize(400, 220);
apa1.setSize(200, 220);
apa2.setSize(200, 220);
}
public static void main(String args[])
{
new xiangxi("详细信息输入");
}
}
说有java.lang.NullPointerException异常///
什么原因啊?
谢谢!