It looks like you have set the position of the box to the point (320,240), which is indeed half of (640,480). The X,Y position of an object will actually be its topleft corner, however. Additionally, you will likely want to make a method for setting this information generically, as opposed to hard-coding it.
If you want to find an object's center position on a given axis (this works for X, Y, or Z, whether you're working in 2D or 3D (or more!?)), you want to take half of its size on that axis and subtract if from its position (which is actually a corner); the result will be the center.
The algorithm you're looking for is essentially this:
xPos = (screenXSize / 2) - (xSize / 2);
yPos = (screenYSize / 2) - (ySize / 2);
To standardize it even further, consider putting your variables in arrays based on how many dimensions you're using - then what I said about using either 2D or 3D automatically applies no matter what you're doing (you can even mix and match 2D and 3D elements in the same game, as is common for certain reasons).
for (int i = 0; i < DIMENSIONS; i++) {
pos[i] = (screenSize[i] / 2) - (size[i] / 2);
}