You should probably read up on the Swing and AWT libraries to learn more about managing GUI layouts and components.

For what you're trying to do, I would recommend taking a look at Box and/or...