F:\java\l1> java Exam1_4 23 432
Exception in thread "main " java.lang.NullPointerException
at java.awt.Container.addImpl(Container.java:621)
at java.awt.Container.add(Container.java:307)
at ApplicationFrame. <init> (Exam1_4.java:27)
at Exam1_4.main(Exam1_4.java:8)
------解决方案--------------------
空异常 代码帖上来啊
------解决方案--------------------
LZ:你的text2都没有初始化,它当然会抛NullPointerException了.
text2=new TextField(4);
------解决方案--------------------
text1=new TextField(4);
text1=new TextField(4);
btn=new Button( "计算 ");
好象有点问题,text1和text2吧
------解决方案--------------------
单步调试一下不就出来了