public void FormEdit(CaseList caselist, ContactList contactlist, boolean createRow)
{
	
	JPanel panel2 = new JPanel(new GridLayout(0,2));
	
	panel2.setPreferredSize(new Dimension(400,200));
	
	panel2.add(new JLabel("Case Add Form"));
	panel2.add(new JLabel (""));
	
	JTextField cf0 = new JTextField(this.getCaseNumber());
	panel2.add(new JLabel("Case Number: "));
	panel2.add(cf0);
	
	JTextField cf1 = new JTextField(this.getCaseName());
	panel2.add(new JLabel("Case Name: "));
	panel2.add(cf1);
	
	JTextField cf2 = new JTextField(this.getCaseDescription());
	panel2.add(new JLabel("Case Description: "));
	panel2.add(cf2);
	
	Vector clientnames = new Vector();
	Vector lawyernames = new Vector();
	Vector paranames = new Vector();
	
	clientnames.add("Select a Client");
	lawyernames.add("Select an Attorney");
	paranames.add("Select a Paralegel");
	
	
	//Get names from the contact table
	for (int i =0; i < contactlist.rowCount(); i++)
	{
		Contact contact = contactlist.getRowContact(i);
		if (contact.getContactType().equals("Customer"))
			clientnames.add(contact.getLastname() + ", " + contact.getFirstname());	
		else if (contact.getContactType().equals("Attorney"))
			lawyernames.add(contact.getLastname() + ", " + contact.getFirstname());	
		else if (contact.getContactType().equals("Paralegal"))
			paranames.add(contact.getLastname() + ", " + contact.getFirstname());	
	}

	
	JComboBox cf3 = new JComboBox(clientnames);
	cf3.setSelectedItem(this.getClientName());
	panel2.add(new JLabel("Client: "));
	panel2.add(cf3);
	
	JComboBox cf4 = new JComboBox(lawyernames);
	cf4.setSelectedItem(this.getLawyer());
	panel2.add(new JLabel("Case Lawyer: "));
	panel2.add(cf4);
	
	JComboBox cf5 = new JComboBox(paranames);
	cf5.setSelectedItem(this.getParalegal());
	panel2.add(new JLabel("Case Paralegal: "));
	panel2.add(cf5);
	
	String[] items3 = {"Inactive", "Active"};
	JComboBox cf6 = new JComboBox(items3);
	cf6.setSelectedItem(this.getStatus());
	panel2.add(new JLabel("Case Status: "));
	panel2.add(cf6);
	
	panel2.add(new JLabel (""));
	panel2.add(new JLabel (""));
	
	
	int result = JOptionPane.showConfirmDialog(null,  panel2, "Case Module", JOptionPane.OK_CANCEL_OPTION, JOptionPane.PLAIN_MESSAGE);
	
	//if ok then save the contents of the form
	if (result == JOptionPane.OK_OPTION)
	{
		this.setCaseNumber(cf0.getText());
		this.setCaseName(cf1.getText());
		this.setCaseDescription(cf2.getText());
		this.setClientName(cf3.getSelectedItem().toString());
		this.setLawyer(cf4.getSelectedItem().toString());
		this.setParalegal(cf5.getSelectedItem().toString());
		if (cf6.getSelectedIndex()==0)
			this.setStatus("Inactive");
		else
			this.setStatus("Active");
		
		
		if(this.validateRecord())
		{
			this.setLoaded(true);
			if (createRow)
			{
			this.saveRecord(caselist);
			}
			
			
			OutputBox.display(0, "Case Module", "Case has been added");
		}
		else
		{
			this.setLoaded(false);
			this.FormEdit(caselist, contactlist, createRow);
		}
	}
		else
		{
			this.initRecord();
			this.setLoaded(false);
		}
	
	}