Canvas object array displays image & text in AppletViewer not IE,Netscape

Hi all,

I have an pure awt applet with ScrollPane. The scroll pane displays an array of SimpleCanvas objects one below another using StackLayout. SimpleCanvas extends java.awt.Canvas and can display both text and images.

This works correctly in AppletViewer (JDK1.3) But when I run this in IE 5.0 and Netscape 4.7, The text is painted but the Image is not painted.

Can any body tell me whats happening and how to fix this?

Regards,

Harsha

harshapr@comatindia.com

PS: Below is the java console message of both IE and Netscape.

<NETSCAPE 4.7 JAVA CONSOLE>

java.lang.NullPointerException

at sun.awt.windows.WToolkit.checkScrImage(Compiled Code)

at sun.awt.windows.WComponentPeer.checkImage(Compiled Code)

at java.awt.Component.checkImage(Compiled Code)

at java.awt.ImageMediaEntry.getStatus(Compiled Code)

at java.awt.MediaTracker.checkAll(Compiled Code)

at java.awt.MediaTracker.checkAll(Compiled Code)

at SimpleCanvas3.paint(Compiled Code)

at java.awt.Component.dispatchEventImpl(Compiled Code)

* at java.awt.Component.dispatchEvent(Compiled Code)

at java.awt.EventDispatchThread$EventPump.dispatchEvents(Compiled Code)

at java.awt.EventDispatchThread.run(Compiled Code)

at netscape.applet.DerivedAppletFrame$AppletEventDispatchThread.run(Compiled Code)

</NETSCAPE 4.7 JAVA CONSOLE>

<IE 5.0 JAVA CONSOLE>

java.lang.NullPointerException

at com/ms/awt/WToolkit.checkScrImage

at com/ms/awt/WComponentPeer.checkImage

at java/awt/Component.checkImage

at java/awt/ImageMediaEntry.getStatus

at java/awt/MediaTracker.checkAll

at java/awt/MediaTracker.checkAll

at SimpleCanvas3.paint

at SimpleCanvas3.update

at com/ms/awt/WComponentPeer.doUpdate

at com/ms/awt/WComponentPeer.doUpdate

at com/ms/awt/WUpdate.run

at com/ms/ui/windowmanager/RunnableMessage.run

at com/ms/awt/WSystemQueue.getMessage

at com/ms/awt/WEventQueue.getNextEvent

at java/awt/EventDispatchThread.run

</IE 5.0 JAVA CONSOLE>

[2179 byte] By [harsha_pr] at [2007-9-26 2:05:19]
# 1

It seems like it can't find your image.

Try if it works with an image you create in your code (rather then loading)

check how you load images and see if access rights on the image work for browsers.

propably just add tot he code that only images that are not null are being painted. mybee for some reason your programm first tries to paint a null image then loads the image and paints again.

arcosh at 2007-6-29 8:50:12 > top of Java-index,Desktop,Core GUI APIs...