For a final project I am making a java address book. I have the tabs set up. I want one tab with a button to add a new entry. The other will search for previous entries. Using the Filereader/Filewriter features I would like to create a database using simple .txt files. Is this possible?

Here is my code so far...

import javax.swing.*;
import java.awt.*;
import java.awt.event.*;

public class TabbedPaneDemo extends JPanel {
public TabbedPaneDemo() {

ImageIcon icon = new ImageIcon("images/middle.gif");
JTabbedPane tabbedPane = new JTabbedPane();

Component panel1 = makeTextPanel("Beta 0.1");


tabbedPane.addTab("Search", icon, panel1, "Search for an Entry");
tabbedPane.setSelectedIndex(0);

Component panel2 = new JButton ("Click Here to Add an Entry");

button.setMnemonic(KeyEvent.VK_I);
button.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
String first, last, telephone, email, address;

first = JOptionPane.showInputDialog("What is the Person's first name?");

last = JOptionPane.showInputDialog("What is the Person's last name?");

email = JOptionPane.showInputDialog("What is the Person's e-mail?");

address = JOptionPane.showInputDialog("What is the Person's address?");
}
});


tabbedPane.addTab("Add", icon, panel2, "Add an Entry");




//Add the tabbed pane to this panel.
setLayout(new GridLayout(1, 1));
add(tabbedPane);
}

protected Component makeTextPanel(String text) {
JPanel panel = new JPanel(false);
JLabel filler = new JLabel(text);
filler.setHorizontalAlignment(JLabel.CENTER);
panel.setLayout(new GridLayout(1, 1));
panel.add(filler);
return panel;
}

public static void main(String[] args) {
JFrame frame = new JFrame("Address Book");
frame.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {System.exit(0);}
});

frame.getContentPane().add(new TabbedPaneDemo(),
BorderLayout.CENTER);
frame.setSize(400, 400);
frame.setVisible(true);
}
}

It gets 2 errors while compiling too :/