I can get the following to work it won’t sort thephone_numbers.dat file for the java program
Complete the implementation for the Sort menu item in the Editmenu. When Sort is selected, the entries should be sorted anddisplayed alphabetically according to last name + first name.
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.event.*;
import java.io.*;
import java.util.Vector;
import java.util.ArrayList;
public class ContactList extends JFrame implements ActionListener,ListSelectionListener {
JMenuItem newMI, openMI, saveMI, saveAsMI, exitMI;
JMenuItem searchMI, deleteMI, updateMI, newEntryMI, sortMI;
JTextField lastName, firstName, phoneNumber;
JList<String> listView;
DefaultListModel<String> nameList = newDefaultListModel<String>();
Vector<String> numberList = newVector<String>();
File currentFile = null;
/**
* Constructor
*/
public ContactList() {
super(“Phone Contacts”); // set frame title
setLayout(new BorderLayout()); // set layout
// create menu bar
JMenuBar menubar = new JMenuBar();
setJMenuBar(menubar);
//
PayPal Gateway not configured
PayPal Gateway not configured