Win a copy of Java 9 Modularity: Patterns and Practices for Developing Maintainable Applications this week in the Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

help with a image animation applet  RSS feed

hennie louw
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi i'm makeing an simple animation applet useing differnt
gif's but when I try to run it it says
java.lang.IllegalArgumentException: adding a window to a container
at java.awt.Container.addImpl(
at java.awt.Container.add(
at AtlanticFlameLogo.init(

heres the code for it , plase help
public class AtlanticFlameLogo extends JApplet implements Runnable
private URL logoFile ;
private Image logo;
private Thread runner = null;
private Color bgColor = new Color(0,0,0);
private Graphics g;

public void init()
logoFile = new URL("//");
}catch(MalformedURLException e)
{ }
}/* End of public void init() */

public void start()
runner = new Thread(this);
}/* End of public void start() */

public void stop()
runner = null;
} /* End of public stop */

public void destroy()
logoFile = null;
logo = null;
bgColor = null;
}/* End of public void destroy */

public void run()
Thread runingT = Thread.currentThread();
while(runingT == runner);
for(int i = 0 ; i < 12 ; i++)
logo = getImage(logoFile ,"img"+i+".gif");
}//end of for
catch(InterruptedException e)
{ }//end of catch
}//end of public void run

public void paint(Graphics g)
g.drawImage(logo, 0 ,0 ,this);
}// End of public void paint(Grahpics g)

}//end of applet
[This message has been edited by hennie louw (edited July 03, 2001).]
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!