Aligning JButton
<p><a href="https://i.stack.imgur.com/FRcCD.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/FRcCD.jpg" alt="This is the output I want pretty much"></a>I have to align a button on my program to the exact middle, the current code I have runs it but displays the button as large as the program, I am wanting a center button that is a specific size, here is what I tried</p>

<pre><code>/**
 * Created by Timk9 on 11/04/2016.
 */
import javax.swing.*;
import java.awt.*;
public class Test extends JFrame {

{
    JFrame window = new JFrame("Test");
    window.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    window.setResizable(true);
    window.setSize(600, 600);
    window.setVisible(true);
    window.setLocationRelativeTo(null);

    JPanel p = new JPanel(new GridBagLayout());
//Button does not appear until I resize the program?
    JButton b1 = new JButton("Click here");
GridBagConstraints c = new GridBagConstraints();

    p.add(b1);
    window.add(p);

        }

public static void main(String[] args) {
new Test();

    }

}
</code></pre>