Hey lads, got a problem here.
Greenfoot shuts down if I execute this code but restarts after a couple of seconds. Does anyone know the reason for that?
-Alex12
import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)
/**
* Write a description of class quitbutton here.
*
* @author (your name)
* @version (a version number or a date)
*/
public class quitbutton extends Actor
{
/**
* Act - do whatever the quitbutton wants to do. This method is called whenever
* the 'Act' or 'Run' button gets pressed in the environment.
*/
public void act()
{
if(Greenfoot.mouseClicked(this)){
System.exit(10);
}
}
}
