It looks like you forgot to specify weightx and weighty for your GridBagConstraints . When you provide them, you will see your JPanel.
Here I changed the code with these restrictions.
And never use this line, headPanel.setSize(200, 150); as I commented on this since the restrictions that I mentioned will be sorted for you.
Adding a new image code:
import java.awt.*; import javax.swing.*;
here is the result:

source share