Following is the code to input proxy settings from user.
public static void setProxy()
{
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new proxy().setVisible(true);
}
});
// Control should halt here till user gives input as it assigns value to the variables
String host = prox;
String port = prt;
System.out.println("Using proxy: " + host + ":" + port);