private void loadPreferences()
    {
        Preferences preferences = BrainPreferences.getPreferences();
        if (preferences != null)
        {
            String leftName = preferences.get(PreferencesNames.LEFT_NAME, "");
            String rightName = preferences.get(PreferencesNames.RIGHT_NAME, "");
            String maxRounds = preferences.get(PreferencesNames.MAX_SCORE, "0");

            leftNameField.setText(leftName);
            rightNameField.setText(rightName);
            roundsCountField.setText(maxRounds);
            dataSourceCombo.setSelectedIndex(Integer.parseInt(preferences.get(PreferencesNames.DATASOURCE, "0")));
            hostnameTextField.setText(preferences.get(PreferencesNames.HOSTNAME, "localhost"));
            databaseNameTextField.setText(preferences.get(PreferencesNames.MYSQL_DATABASE, ""));
            usernameTextField.setText(preferences.get(PreferencesNames.MYSQL_USERNAME, ""));
            passwordTextField.setText(preferences.get(PreferencesNames.MYSQL_PASSWORD, ""));

            selectDataSource();

            NamesManager.getInstance().setNames(leftName, rightName);
            RoundManager.getInstance().setMaxRound(Integer.parseInt(maxRounds));
        }

    }