Я делаю простой графический интерфейс адресной книги и не очень хорошо разбираюсь в макетах. Я хочу, чтобы мой графический интерфейс выглядел следующим образом ...

Вот мой ВОДИТЕЛЬ:
import javax.swing.*;
public class AddressBookGui {
public static void main (String[] args)
{
userInput addressBook = new userInput();
addressBook.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); //whenever you hit x you will exit the program
addressBook.setSize(750, 600);
addressBook.setVisible(true);
}
}
This is my USERINPUT class
import java.awt.*;
import javax.swing.*;
public class userInput extends JFrame {
private JButton newEntry;
private JButton deleteEntry;
private JButton editEntry;
private JButton saveEntry;
private JButton cancelEntry;
private FlowLayout layout;
private JTextField lastName;
private JTextField middleName;
private JTextField firstName;
private JTextField phone;
public userInput() {
super("My Address Book"); //sets the title!
Container content = getContentPane();
JPanel buttonPanel = new JPanel();
buttonPanel.setLayout(new FlowLayout());
newEntry = new JButton("New");
deleteEntry = new JButton("Delete");
editEntry = new JButton("Edit");
saveEntry = new JButton("Save");
cancelEntry = new JButton("Cancel");
buttonPanel.add(newEntry);
buttonPanel.add(deleteEntry);
buttonPanel.add(editEntry);
buttonPanel.add(saveEntry);
buttonPanel.add(cancelEntry);
add(buttonPanel, BorderLayout.SOUTH);
content.setLayout(new BorderLayout());
content.add(buttonPanel, "South");
lastName = new JTextField(10); //set the length to 10.
add(lastName); //adds item1 to the window
firstName = new JTextField(10);
add(firstName);
middleName = new JTextField(10);
add(middleName);
phone = new JTextField(10);
add(phone);
setVisible(true);
}
}
В настоящее время у меня есть кнопки внизу, но графический интерфейс - это всего лишь одно гигантское текстовое поле. Спасибо за помощь.