Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • 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
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

help with a image animation applet

 
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(Container.java:336)
at java.awt.Container.add(Container.java:228)
at AtlanticFlameLogo.init(AtlanticFlameLogo.java:23)
at sun.applet.AppletPanel.run(AppletPanel.java:344)
at java.lang.Thread.run(Thread.java:484)

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()
{
try
{
logoFile = new URL("//");
}catch(MalformedURLException e)
{ }
}/* End of public void init() */

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

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



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

public void run()
{
Thread runingT = Thread.currentThread();
while(runingT == runner);
try
{
for(int i = 0 ; i < 12 ; i++)
{
logo = getImage(logoFile ,"img"+i+".gif");
repaint();
Thread.sleep(100);
}//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).]
 
You didn't tell me he was so big. Unlike this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic