private void savePreferences()
    {
        Preferences preferences = BrainPreferences.getPreferences();
        preferences.put(PreferencesNames.LEFT_NAME, this.leftNameField.getText());
        preferences.put(PreferencesNames.RIGHT_NAME, this.rightNameField.getText());
        preferences.put(PreferencesNames.MAX_SCORE, roundsCountField.getText());
        preferences.put(PreferencesNames.DATASOURCE, String.valueOf(dataSourceCombo.getSelectedIndex()));
        preferences.put(PreferencesNames.HOSTNAME, hostnameTextField.getText());
        preferences.put(PreferencesNames.MYSQL_DATABASE, databaseNameTextField.getText());
        preferences.put(PreferencesNames.MYSQL_USERNAME, usernameTextField.getText());
        preferences.put(PreferencesNames.MYSQL_PASSWORD, passwordTextField.getText());

        try
        {
            preferences.flush();
        }
        catch (BackingStoreException e)
        {
            handleError("Cannot save settings", e);
        }
    }