public void setPreferencesProxyDTO(PreferencesProxyDTO preferencesProxyDTO) { switch (preferencesProxyDTO.getProxySettingType()) { case 0: noProxyRadioButton.setSelected(true); break; case 1: systemProxyRadioButton.setSelected(true); break; case 2: manualProxyRadioButton.setSelected(true); } if (preferencesProxyDTO.isUseProxyNotSocks()) useProxyRadioButton.setSelected(true); else useSocksRadioButton.setSelected(true); // for http httpProxyAddressTextField.setText(preferencesProxyDTO.getHttpProxyAddress()); httpProxyPortSpinner.setValue(preferencesProxyDTO.getHttpProxyPort()); httpProxyUserNameTextField.setText(preferencesProxyDTO.getHttpProxyUserName()); httpProxyPasswordField.setText(preferencesProxyDTO.getHttpProxyPassword()); // for https httpsProxyAddressTextField.setText(preferencesProxyDTO.getHttpsProxyAddress()); httpsProxyPortSpinner.setValue(preferencesProxyDTO.getHttpsProxyPort()); httpsProxyUserNameTextField.setText(preferencesProxyDTO.getHttpsProxyUserName()); httpsProxyPasswordField.setText(preferencesProxyDTO.getHttpsProxyPassword()); // for ftp ftpProxyAddressTextField.setText(preferencesProxyDTO.getFtpProxyAddress()); ftpProxyPortSpinner.setValue(preferencesProxyDTO.getFtpProxyPort()); ftpProxyUserNameTextField.setText(preferencesProxyDTO.getFtpProxyUserName()); ftpProxyPasswordField.setText(preferencesProxyDTO.getFtpProxyPassword()); // for ftp socksProxyAddressTextField.setText(preferencesProxyDTO.getSocksProxyAddress()); socksProxyPortSpinner.setValue(preferencesProxyDTO.getSocksProxyPort()); socksProxyUserNameTextField.setText(preferencesProxyDTO.getSocksProxyUserName()); socksProxyPasswordField.setText(preferencesProxyDTO.getSocksProxyPassword()); this.preferencesProxyDTO = preferencesProxyDTO; }