my dog learned polymorphism
The moose likes Swing / AWT / SWT and the fly likes Problem Loading Image in Applet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Problem Loading Image in Applet" Watch "Problem Loading Image in Applet" New topic

Problem Loading Image in Applet

Dave Wingate
Ranch Hand

Joined: Mar 26, 2002
Posts: 262
Howdy all,
I've run into a snag with a pretty trivial applet. The applet adds an extended Canvas, whose constructor loads an image. My code works just fine under Win NT and appletviewer - the canvas draws the image as expected.
The problem I encounter is with Win 98. When I load the applet on that platform, the canvas only draws the upper left portion of the image. Does any one know of a fix I can use to get arround this problem for Win 98?
The constructor code that I use is below:

Any suggestions would really be appreciated.

Fun programming etcetera!
Nathan Pruett

Joined: Oct 18, 2000
Posts: 4121

You're running the applet in Windows 98 under AppletViewer, too, right? Not a web browser? Are the same versions of Java installed? And what type and size of image are you trying to load?

Maybe also post the actual code where the canvas is painting the image...

Write once, run anywhere, because there's nowhere to hide! - /. A.C.
Dave Wingate
Ranch Hand

Joined: Mar 26, 2002
Posts: 262
I've tried to run it in both appletviewer and IE on Win98; I get the same result with either. More complete code follows:
I agree. Here's the link:
subject: Problem Loading Image in Applet
It's not a secret anymore!