Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

postEvent 1

Status
Not open for further replies.

ngl2

Programmer
Apr 9, 2001
2
GB
I have a Java applet which pops up a window which is a subclass of JFrame to which a JPanel subclass is added. This works perfectly well for 99% of the time, but occasionally appears completely blank and the following exception is thrown,

java.lang.NullPointerException
at sun.awt.SunToolkit.postEvent(Unknown Source)
at sun.awt.windows.WComponentPeer.postEvent(Unknown Source)
at sun.awt.windows.WToolkit.eventLoop(Native Method)
at sun.awt.windows.WToolkit.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

That is all that appears in the Java console so there are no pointers into my code.

I am using Netscape 4.75 with the following plugin:

Java(TM) Plug-in: Version 1.3.0_02
Using JRE version 1.3.0_02 Java HotSpot(TM) Client VM

I would appreciate any advice on how to track down the source of this problem.
 
From the sound of your problem... I would have to say that there is a place in your code where you set a variable to null. And on occasion it is not set to what you intend it to be and the null value is being used (which can not be apparently).

I would look over your code and trace what is happening in as many situations as possible. You may find that you forgot to code for something... which in turn is causing that NullPointerException.

I can't give you anymore than that because I have no code to work from.

I hope this helped! ;-)
- Casey Winans
 
Thank you for the reply, but normally a nullPointerException will print out the code line number where the exception was thrown. In this case it appears to be thrown within the SunToolKit code.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top