I'm building a small app for a programming assignment. I've worked with the GridBagLayout before, and got perfect on that assignment, but this time... well... I'm pulling my hair out.

There are three classes. It's a work in progress so some stuff may be a bit messy.

The problem: The two JLabels, "Artists" and "Songs", get smushed into the side. I'm not sure why. They are in different cells than the JTextField, and the JTextField only has a height of 1. Additionally, the JTextField seems to span only 2 cells, even though I explicitly set it to span 3. I've double checked all of the widths and positions. I can't see my error.

public class JTunesBrowser {
 
	public static void main(String[] args) {
		JTunesFrame theFrame = new JTunesFrame("JTunesBrowser");
		theFrame.setVisible(true);
	}
 
}

import javax.swing.*;
 
public class JTunesFrame extends JFrame {
 
	private JMenuBar theMenuBar;
	private JMenu fileMenu;
	private JMenuItem openItem, exitItem;
 
	public JTunesFrame(String name) {
		super(name);
		setDefaultCloseOperation(EXIT_ON_CLOSE);
		setSize(800, 600);
		setResizable(true);
		setContentPane(new JTunesPanel());
		theMenuBar = new JMenuBar();
		setJMenuBar(theMenuBar);
 
		fileMenu = new JMenu(String.format("%-10s", "File"));
		openItem = new JMenuItem("Open");
		fileMenu.add(openItem);
		exitItem = new JMenuItem("Exit");
		fileMenu.add(exitItem);
		theMenuBar.add(fileMenu);
 
	}
 
}

import javax.swing.*;
import java.awt.*;
 
public class JTunesPanel extends JPanel {
 
	private JButton searchButton;
	private JRadioButton artistRadio, songRadio;
	private JTextField searchField;
	private JLabel artistsLabel, songsLabel;
	private JList artistList, songList;
	private GridBagLayout layout;
	private GridBagConstraints constraints;
	private JScrollPane	songScrollPane, artistScrollPane;
 
    public JTunesPanel() {
    	layout = new GridBagLayout();
		setLayout(layout);
		constraints = new GridBagConstraints();
 
		searchField = new JTextField();
		constraints.gridx = 0;
		constraints.gridy = 0;
		constraints.gridwidth = 3;
		constraints.gridheight = 1;
		constraints.fill = GridBagConstraints.BOTH;
		constraints.anchor = GridBagConstraints.WEST;
		constraints.insets = new Insets(5, 5, 5, 5);
		constraints.weightx = 75;
		constraints.weighty = 0;
		layout.setConstraints(searchField, constraints);
		add(searchField);
 
		searchButton = new JButton("Search");
		constraints.gridx = 3;
		constraints.gridy = 0;
		constraints.gridwidth = 1;
		constraints.gridheight = 1;
		constraints.fill = GridBagConstraints.NONE;
		constraints.anchor = GridBagConstraints.WEST;
		constraints.insets = new Insets(5, 5, 5, 5);
		constraints.weightx = 0;
		constraints.weighty = 0;
		layout.setConstraints(searchButton, constraints);
		add(searchButton);
 
		artistsLabel = new JLabel("Artists");
		constraints.gridx = 0;
		constraints.gridy = 1;
		constraints.gridwidth = 2;
		constraints.gridheight = 1;
		constraints.fill = GridBagConstraints.BOTH;
		constraints.anchor = GridBagConstraints.CENTER;
		constraints.insets = new Insets(5, 5, 5, 5);
		constraints.weightx = 50;
		constraints.weighty = 0;
		add(artistsLabel);
 
		songsLabel = new JLabel("Songs");
		constraints.gridx = 2;
		constraints.gridy = 1;
		constraints.gridwidth = 2;
		constraints.gridheight = 1;
		constraints.fill = GridBagConstraints.BOTH;
		constraints.anchor = GridBagConstraints.CENTER;
		constraints.insets = new Insets(5, 5, 5, 5);
		constraints.weightx = 50;
		constraints.weighty = 0;
		add(songsLabel);
 
		artistList = new JList();
		constraints.gridx = 0;
		constraints.gridy = 2;
		constraints.gridwidth = 2;
		constraints.gridheight = 1;
		constraints.fill = GridBagConstraints.BOTH;
		constraints.anchor = GridBagConstraints.CENTER;
		constraints.insets = new Insets(5, 5, 5, 5);
		constraints.weightx = 50;
		constraints.weighty = 0;
		artistScrollPane = new JScrollPane(artistList, ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
		layout.setConstraints(artistScrollPane, constraints);
		add(artistScrollPane);
 
		songList = new JList();
		constraints.gridx = 2;
		constraints.gridy = 2;
		constraints.gridwidth = 2;
		constraints.gridheight = 1;
		constraints.fill = GridBagConstraints.BOTH;
		constraints.anchor = GridBagConstraints.CENTER;
		constraints.insets = new Insets(5, 5, 5, 5);
		constraints.weightx = 50;
		constraints.weighty = 0;
		songScrollPane = new JScrollPane(songList, ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
		layout.setConstraints(songScrollPane, constraints);
		add(songScrollPane);
 
    }
 
}