This site requires JavaScript, please enable it in your browser!
Greenfoot back
erdelf
erdelf wrote ...

2012/6/10

NullpointerException with mouse

erdelf erdelf

2012/6/10

#
Hello, I have this code
        MouseInfo mouse = Greenfoot.getMouseInfo();

        if (Greenfoot.mousePressed(null))
        {
            if (mouse.getButton() == 1)
            {
            }
        }
And in the line with the Buttoncheck I get a NullpointerException. Could anyone explain what this means? I have a mouse so I am wondering what this could be
erdelf erdelf

2012/6/10

#
Oh well, I see why this comes. I was on low Speed and it seems like I clicked and then moved my mouse outside of the world
You need to login to post a reply.