I'm trying to create a new UI for database project. However, I keep getting a nullpointerexception at creating a new GUI object, and when adding content. Here is my code:
class DatabaseGUI extends JFrame implements ActionListener {
JTextField input;
JTextArea restult;
JButton loadButton;
JButton saveButton;
public static void main(String[] args){
DatabaseGUI databaseGUI = new DatabaseGUI();
databaseGUI.setVisible(true);
}
DatabaseGUI(){
this.setTitle("Emplyoee Database");
this.setDefaultCloseOperation(EXIT_ON_CLOSE);
Container content = getContentPane();
content.setLayout(new FlowLayout());
content.add(saveButton);
}