Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Beans novice question

0 views
Skip to first unread message

Vassil Roussev

unread,
Mar 12, 1997, 3:00:00 AM3/12/97
to

Hi,

I'm trying to get started on JavaBeans the standard way - by running the
examples. However, I've unable to do so. I looked at the tutorial and
tried to compile the example code and I am getting a warning:

javac -deprecation Acme07Bean.java
Acme07Bean.java:73: Note: The method boolean postEvent(java.awt.Event)
in
class java.awt.Component has been deprecated.
parent.postEvent(new Event(this, Event.MOUSE_DOWN, null));
^
I understand the point but it should still be working. When I try to
load the class from the BeanBox I get:

java.lang.NullPointerException
at java.io.ObjectInputStream.read(ObjectInputStream.java)
at java.io.DataInputStream.readShort(DataInputStream.java)
at java.io.ObjectInputStream.readShort(ObjectInputStream.java)
at
java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java)
at java.io.ObjectInputStream.<init>(ObjectInputStream.java)
at
sun.beanbox.ObjectInputStreamWithLoader.<init>(ObjectInputStreamWithLoader.java:
21)
at sun.beanbox.BeanBox.load(BeanBox.java:309)
at sun.beanbox.BeanBox.doMenuItem(BeanBox.java:787)
at sun.beanbox.BeanBox.run(BeanBox.java:931)
at java.lang.Thread.run(Thread.java)

Can anybody tell me what's wrong?

Thanx much

--VR

------------------------------
VASSIL R. ROUSSEV
University of North Carolina
Department of Computer Science
CB #3175, 346 Sitterson Hall
Chapel Hill, NC 27599
e-mail: ru...@cs.unc.edu
phone: (919) 962-1719
------------------------------

Jere McDevitt

unread,
Mar 17, 1997, 3:00:00 AM3/17/97
to

On Wed, 12 Mar 1997 13:15:16 -0500, Vassil Roussev <ru...@cs.unc.edu>
wrote:

>SNIP<


> parent.postEvent(new Event(this, Event.MOUSE_DOWN, null));
> ^
>I understand the point but it should still be working. When I try to
>load the class from the BeanBox I get:
>
>java.lang.NullPointerException
> at java.io.ObjectInputStream.read(ObjectInputStream.java)

>SNIP<

postEvent has nothing to do with I/O. Your error indicates the null
pointer has to do with trying to read to possibly a null variable from
an I/O stream. If you could post the code along with the error it
might be possible to isolate the problem.

As for DEPRECATION. Notice that on compile, the deprecation
information is a NOTE (warning) not an ERROR. Use of these methods is
still supported for now, but will not be in the future. You can get
the NOTES and the application will still run.

Just post the relevent code and let us take a look.

Jere
JavaSoft

0 new messages