public PreferencesProxyDTO getPreferencesProxyDTO() { String proxySettingType = proxySettingGroup.getSelection().getActionCommand(); switch (proxySettingType) { case "noProxy": preferencesProxyDTO.setProxySettingType(0); break; case "systemProxy": preferencesProxyDTO.setProxySettingType(1); break; case "manualProxy": preferencesProxyDTO.setProxySettingType(2); } if (useProxyRadioButton.isSelected()) preferencesProxyDTO.setUseProxyNotSocks(true); else preferencesProxyDTO.setUseProxyNotSocks(false); // for http preferencesProxyDTO.setHttpProxyAddress(httpProxyAddressTextField.getText()); preferencesProxyDTO.setHttpProxyPort((Integer) httpProxyPortSpinner.getValue()); preferencesProxyDTO.setHttpProxyUserName(httpProxyUserNameTextField.getText()); preferencesProxyDTO.setHttpProxyPassword(new String(httpProxyPasswordField.getPassword())); // for https preferencesProxyDTO.setHttpsProxyAddress(httpsProxyAddressTextField.getText()); preferencesProxyDTO.setHttpsProxyPort((Integer) httpsProxyPortSpinner.getValue()); preferencesProxyDTO.setHttpsProxyUserName(httpsProxyUserNameTextField.getText()); preferencesProxyDTO.setHttpsProxyPassword(new String(httpsProxyPasswordField.getPassword())); // for ftp preferencesProxyDTO.setFtpProxyAddress(ftpProxyAddressTextField.getText()); preferencesProxyDTO.setFtpProxyPort((Integer) ftpProxyPortSpinner.getValue()); preferencesProxyDTO.setFtpProxyUserName(ftpProxyUserNameTextField.getText()); preferencesProxyDTO.setFtpProxyPassword(new String(ftpProxyPasswordField.getPassword())); // for ftp preferencesProxyDTO.setSocksProxyAddress(socksProxyAddressTextField.getText()); preferencesProxyDTO.setSocksProxyPort((Integer) socksProxyPortSpinner.getValue()); preferencesProxyDTO.setSocksProxyUserName(socksProxyUserNameTextField.getText()); preferencesProxyDTO.setSocksProxyPassword(new String(socksProxyPasswordField.getPassword())); return preferencesProxyDTO; }