What do you mean by 'automatically'? please elaborate. When are you adding the button into the world? Will it be in the world from the start, or added later? if later, what trigger is used to signify that you need to add it into the world (what kind of class is the trigger in)? How long will the button remain in the world?
The coordinates are set when you add the button object into the world with 'addObject(button, x-coordinate, y-coordinate);' or 'getWorld().addObject(button...);'.