• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

applet LoadAGif can't start: error????

 
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i've tried the code in displaying picture(gif) from the javaranch code barn. It's working well in appletviewer and ie5 but when i run in netscape an error message appear (applet LoadAGif can't start: error). why is this so? thus netscape doesn't support java?

here's the code:
import java.applet.* ;
import java.awt.* ;

public class LoadAGif extends Applet
{
private Image myImage ;
public void init()
{
myImage = getImage( getCodeBase() , "superduke.gif" );
// use a MediaTracker so the image will be downloaded
// completely before being displayed
MediaTracker mt = new MediaTracker( this );
mt.addImage( myImage , 0 );
try
{
mt.waitForAll(); // blocks here until Image is fully downloaded
}
catch ( InterruptedException e )
{
}
}// close init
public void paint( Graphics g )
{
g.drawImage( myImage , 25 , 25 , this );
}// close paint
}// close applet

raymond
 
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have had this same problem with Netscape. Netscape seems very picking about displaying images.
Yesterday I found an applet in which Netscape was able to display an image, but I changed the name of the class and the applet would not work in Netscape any more even though it still worked in both IE and appletviewer.
Does anyone know what is going on?
 
Daniel Olson
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I just notice I am getting this same error when I try to look at the code example on this site with Netscape.
http://javaranch.com/CodeBarn/BarnLoadGifApplet.jsp
 
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm new to applets but have noticed that netcrap is very much less forgiving of HTML errors. For example, if you forget the <form> tag, IE will still display form objects, input fields etc, but netcrap will not. Possibly this unforgivingness carries over to the applet world. Look for some small syntax error that netcrap may be choking on and IE is handling ok.
 
What are you doing in my house? Get 'em tiny ad!
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic