So I am supposed to make a very simple fillout form like name: ______, and they are supposed to be underneath each other , but when I add these JTextFields and JLabels to the JFrame I get an empty JFrame.
JFrame frame = new JFrame("Name's Item Orders Calculator");
JPanel panel = new JPanel();
BorderLayout layout = new BorderLayout(0,2);
JTextField nameField = new JTextField(15);
JTextField numberField = new JTextField(15);
JTextField costField = new JTextField(15);
JTextField amountField = new JTextField(15);
JLabel name = new JLabel("Item Name: ");
JLabel number = new JLabel("Number of: ");
JLabel cost = new JLabel("Cost: ");
JLabel amount = new JLabel("Amount owed: ");
panel.add(name, BorderLayout.WEST);
panel.add(number, BorderLayout.WEST);
panel.add(cost, BorderLayout.WEST);
panel.add(amount, BorderLayout.WEST);
panel.add(nameField, BorderLayout.EAST);
panel.add(numberField, BorderLayout.EAST);
panel.add(costField, BorderLayout.EAST);
panel.add(amountField, BorderLayout.EAST);
/*
panel.add(new JLabel("North"), BorderLayout.WEST);
panel.add(new JLabel("Another North"), BorderLayout.WEST);
*/
frame.pack();
frame.add(panel);
frame.setLayout(layout);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setSize(400, 200);
frame.setLocationRelativeTo(null);
frame.setVisible(true);