If the proxy need "basic" authentification, do that :
URL url = new URL("www.google.com"));
URLConnection urlConn = url.openConnection();
String auth = "Basic " + new sun.misc.BASE64Encoder().encode("user:password".getBytes());
urlConn.setRequestProperty("Proxy-Authorization", auth);
otherwise do that
Properties systemProperties = System.getProperties();
systemProperties.setProperty("http.proxyHost", proxy);
systemProperties.setProperty("http.proxyPort", port);
Authenticator.setDefault(new SimpleAuthenticator(username,password));
SimpleAuthenticator extends java.net.Authenticator