I'm trying to establish a URLConnection based on outcome of JDialog but it looks like URLConnection does not wait till JDialog outputs something and proceed with result as null. The JDialog gets inputs from user and prepares an URL based on selection. I want to pass this URL to URLConnection to establish it but it looks like as soon as user clicks on any button, URLConnection does not wait to get the URL from dialog and proceed assuming its null.
Is it possible to make URLConnection to wait till the JDialog finishes? Can anyone please help me to make this working (to wait till Jdialog returns something)?