public void act()
    {
        if (Greenfoot.mouseMoved(this) || Greenfoot.mouseDragged(this))
            overThis = true;
        else if (Greenfoot.mouseMoved(null) || Greenfoot.mouseDragged(null))
            overThis = false;
        if (Greenfoot.mousePressed(this))
        {
            boolean f = focus;
            focus = true;
            if (!f)
                gainedFocus();
        }
        else if (Greenfoot.mousePressed(null))
            focus = false;
    }