would this put the two JPanels inside the JFrame or would I need to make a container of some sort?
I am just trying to get the JTextField to take up only 1 column above the buttons instead of being put in the column with all the buttons.
window = new JFrame("Window");
displayBox = new JTextField(20);
display = new JPanel(new GridLayout(0, 1));
buttons = new JPanel(new GridLayout(0, 3));
b0 = new JButton("0");
b1 = new JButton("1");
//...
window.getContentPane().add(display);
display.add(displayBox);
window.getContentPane().add(buttons);
buttons.add(b0);
buttons.add(b1);
//...
window.pack();
window.setSize(300, 400);
window.setVisible(true);
window.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
if you change the code to
that should add the JPanels into the JFrame 1 ontop of the other.