JPanel panel = getContentPane(); panel.setLayout(new GridLayout(-1, 1)); JButton button = new JButton("Test!"); panel.add(button);