init() called before paint()

Ryan Heise rheise at socs.uts.EDU.AU
Tue Jul 14 22:51:04 PDT 1998


On Wed, 15 Jul 1998, Ryan Heise wrote:

: One of my applets does not work with the kaffe appletviewer because paint()
: seems to be getting called before init() is finished executing. I assume
: that variables I initialise in init() exist when I'm painting the applet
: but I get a NullPointerException instead.

Some more information on this:

I'm using MediaTracker.waitForID() inside init() which is allowing other
threads to execute their stuff. This is where I think the AWT thread
starts exeecuting. Here's part of the stack trace:

java.lang.NullPointerException
	...
	at java/awt/Container.paint(297)
	at java/awt/Window.processPaintEvent(159)
	at java/awt/AWTEvent.processPaintEvent(417)
	at java/awt/event/PaintEvent.dispatch(32)
	at java/awt/EventDispatchThread.show(126)
	at java/awt/WMEvent.dispatch(48)
	at java/awt/EventDispatchThread.run(38)

This is not identicle to the behaviour Sun's JDK displays.

Ryan Heise                             http://www.progsoc.uts.edu.au/~rheise/
=============================================================================
main(){printf("%d != %d, why?\n", sizeof('"')["'"],(sizeof('"'))["]\"\0["]);}
=============================================================================



More information about the kaffe mailing list