import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)
/**
* Write a description of class Introduction here.
*
* @author (your name)
* @version (a version number or a date)
*/
public class Introduction extends Actor
{
private GifImage gif = new GifImage("introduction.gif");
/**
* Act - do whatever the Introduction wants to do. This method is called whenever
* the 'Act' or 'Run' button gets pressed in the environment.
*/
public void act()
{
setImage(gif.getCurrentImage());
}
}
This is a simple code that procs a fully animated introduction for my boss, however, I get this error whenever I place it inside the world -
at GifImage.loadImages(GifImage.java:150)
at GifImage.<init>(GifImage.java:66)
at Introduction.<init>(Introduction.java:11)
at Introduce.prepare(Introduce.java:29)
at Introduce.<init>(Introduce.java:20)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
at greenfoot.core.Simulation.newInstance(Simulation.java:607)
at greenfoot.platforms.ide.WorldHandlerDelegateIDE$4.run(WorldHandlerDelegateIDE.java:445)
at greenfoot.core.Simulation.runQueuedTasks(Simulation.java:494)
at greenfoot.core.Simulation.maybePause(Simulation.java:299)
at greenfoot.core.Simulation.runContent(Simulation.java:212)
at greenfoot.core.Simulation.run(Simulation.java:205)
java.lang.OutOfMemoryError: Java heap space
java.lang.OutOfMemoryError: Java heap space
java.lang.OutOfMemoryError: Java heap space
java.lang.OutOfMemoryError: Java heap space
