buttonPanel.setLayout(new GridLayout(1, 4, 4, 4));
// Create the buttons.
addButton("Sports", new ImageIcon("images/sports.gif"));
addButton("Music", new ImageIcon("images/music.gif"));
addButton("Travel", new ImageIcon("images/travel.gif"));
addButton("Art", new ImageIcon("images/art.gif"));
// Layout.
Container c = getContentPane();
c.setLayout(new BorderLayout());
c.add(new JLabel("Select an Activity"), BorderLayout.NORTH);
c.add(buttonPanel, BorderLayout.CENTER);
pack();