private void jTextFieldLogFileNameFocusLost(java.awt.event.FocusEvent evt)//GEN-FIRST:event_jTextFieldLogFileNameFocusLost
    {//GEN-HEADEREND:event_jTextFieldLogFileNameFocusLost
	// Remove old value, but save the index for the new value
	int index = jListTemplateLogFiles.getSelectedIndex();

	Log editedLog = Preferences.getInstance().getLog((String) jListTemplateLogFiles.getSelectedValue());

	String newName = jTextFieldLogFileName.getText();

	// Make sure there actually is a log selected
	if (editedLog == null || index == -1 || newName.equals((String) jListLogFiles.getSelectedValue()))
	{
	    return;
	}

	if (newName.equals(""))
	{
	    JOptionPane.showMessageDialog(this, "Name cannot be empty!");
	    jTextFieldLogFileName.setText((String) jListTemplateLogFiles.getSelectedValue());
	    return;
	}
	else if (newName.equals((String) jListTemplateLogFiles.getSelectedValue()))
	{
	    // No change has been done, so we just disregard this event
	    return;
	}
	else if (templateLogFilesListModel.contains(newName))
	{
	    JOptionPane.showMessageDialog(this, "There is another entry with the same name!");
	    jTextFieldLogFileName.setText((String) jListTemplateLogFiles.getSelectedValue());
	    return;
	}

	Preferences.getInstance().removeLog(editedLog.getName());

	// Verify if any of the servers has this log
	for (int i = 0; i < serverListModel.size(); ++i)
	{
	    Server server = Preferences.getInstance().getServer((String) serverListModel.get(i));

	    if (server.removeLog(editedLog.getName()))
	    {
		server.addLog(newName);
	    }
	}

	// Modify the value
	editedLog.setName(newName);

	// Insert into list and prefs
	Preferences.getInstance().addLog(editedLog);
	templateLogFilesListModel.set(index, editedLog.getName());

	// Select it
	jListTemplateLogFiles.setSelectedIndex(index);

	// Sort the list with the new value
	sortList(jListTemplateLogFiles, ListComparator.Type.LOG);
    }