Writing a GUI application with a box layout