Use the 'bounded' parameter to the World class constructor to specify whether you want a world to be bounded (actors contained within world bounds) or unbounded (unconstrained actors). Normally your world constructor has a line like:
super(600, 400, 1);
You need to add the 'bounded' parameter. For an unbounded world, that should be false: