Is that the container that holds the component? Like a JPanel?
And also what does "relative to" mean? Sorry, but english is not my first langauge.
Some systems do it one way, some systems do it another way.
The mouse coordinates need to be relative to something. "Relative to" means the location where (0,0) is at.
Often they are relative to the top left corner of the screen.
[attachment=30246:screen-upper-left.PNG]
Many old systems in the 1970s and 1980s had mouse positions relative to the bottom left corner of the screen.
[attachment=30248:screen-lower-left.PNG]
Many systems can get mouse positions relative to a specific window. This is probably the corner used in your code's button.setLocation().
[attachment=30249:window-top-left.PNG]
Other times the position is relative to a specific panel
[attachment=30247:control-top-left.PNG]
Other times the position is relative to a specific button or UI control. This is probably the corner used in your code's e.getX() and e.getY().
[attachment=30250:button-relative.PNG]
Different systems choose different locations, and where the (0,0) position is centered depends on what object is listening to the event and how the system is implemented.
In the case of your code:
x = button.getX() + e.getX();
y = button.getY() + e.getY();
button.setLocation(x,y);
Probably e.getX and e.getY are getting the position relative to the button. This is like the final image above.
Then the programmer wants to turn it back into a position relative to the entire screen, so they add the button's screen position to the mouse position relative to the button position.